update files
This commit is contained in:
+2
-1
@@ -1 +1,2 @@
|
|||||||
.xlsx
|
csv/
|
||||||
|
TR_VD_Lotus-SuspGen-data.docx
|
||||||
Binary file not shown.
@@ -1,23 +0,0 @@
|
|||||||
clear;
|
|
||||||
clc;
|
|
||||||
|
|
||||||
prompt = 'Press "1" for front or "2" for rear: ';
|
|
||||||
side = input(prompt, 's');
|
|
||||||
|
|
||||||
[frontrear, fileName, sheetName] = selectSide(side);
|
|
||||||
|
|
||||||
if frontrear == 'front'
|
|
||||||
Parameter = who('-file', 'M22H_FrontSuspension_Data.mat');
|
|
||||||
elseif frontrear == 'rear'
|
|
||||||
Parameter = who('-file', 'M22H_RearSuspension_Data.mat');
|
|
||||||
end;
|
|
||||||
|
|
||||||
t = array2table(Parameter);
|
|
||||||
|
|
||||||
fprintf('Initializing exporting process \n');
|
|
||||||
|
|
||||||
for i=1:length(61)
|
|
||||||
writetable(t, fileName, 'Sheet', sheetName, 'WriteVariableNames', false);
|
|
||||||
end;
|
|
||||||
|
|
||||||
fprintf('Finished exporting!\n')
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
clear;
|
|
||||||
clc;
|
|
||||||
|
|
||||||
prompt = 'Press "1" for front or "2" for rear: ';
|
|
||||||
side = input(prompt, 's');
|
|
||||||
|
|
||||||
[fileName, frontrear, sheetName] = selectSide(side);
|
|
||||||
|
|
||||||
if strcmp(frontrear, 'front')
|
|
||||||
Parameter = who('-file', 'M22H_FrontSuspension_Data.mat');
|
|
||||||
elseif strcmp(frontrear, 'rear')
|
|
||||||
Parameter = who('-file', 'M22H_RearSuspension_Data.mat');
|
|
||||||
end;
|
|
||||||
|
|
||||||
t = array2table(Parameter);
|
|
||||||
|
|
||||||
fprintf('Initializing exporting process \n');
|
|
||||||
|
|
||||||
for i=1:length(61)
|
|
||||||
writetable(t, fileName, 'Sheet', sheetName, 'WriteVariableNames', false);
|
|
||||||
end;
|
|
||||||
|
|
||||||
fprintf('Finished exporting!\n')
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
function [content, filename, sheetName] = selectSide(input);
|
|
||||||
|
|
||||||
%0 is front, 1 is rear
|
|
||||||
|
|
||||||
if rem(input, 2) == 0
|
|
||||||
content = who('-file', 'M22H_FrontSuspension_Data.mat');
|
|
||||||
filename = 'FrontSuspension_Exported.xlsx';
|
|
||||||
sheetName = 'Front';
|
|
||||||
elseif input/2 != 0
|
|
||||||
content = who('-file', 'M22H_RearSuspension_Data.mat');
|
|
||||||
filename = 'RearSuspension_Exported.xlsx';
|
|
||||||
sheetName = 'Rear';
|
|
||||||
else
|
|
||||||
fprintf = 'Input must be "front" or "rear";
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
+2
-4
@@ -5,11 +5,9 @@ function [fileName, frontrear, sheetName] = selectSide(input);
|
|||||||
fileName = 'SuspensionData_Exported.xlsx';
|
fileName = 'SuspensionData_Exported.xlsx';
|
||||||
|
|
||||||
if rem(input, 2) == 1
|
if rem(input, 2) == 1
|
||||||
frontrear = 'front';
|
carSide = 'front';
|
||||||
sheetName = 'Front';
|
|
||||||
elseif rem(input, 2) == 0
|
elseif rem(input, 2) == 0
|
||||||
frontrear = 'rear';
|
carSide = 'rear';
|
||||||
sheetName = 'Rear';
|
|
||||||
else
|
else
|
||||||
fprintf = 'An error occured!';
|
fprintf = 'An error occured!';
|
||||||
end;
|
end;
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
selectSide(front);
|
||||||
|
%selectSide(rear);
|
||||||
|
|
||||||
|
if carSide == 'front'
|
||||||
|
FileData = load('M22H_FrontSuspension_Data.mat');
|
||||||
|
elseif carSide == 'rear'
|
||||||
|
FileData = load('M22H_RearSuspension_Data.mat');
|
||||||
|
else
|
||||||
|
error('Error: %s is not a valid input', carSide)
|
||||||
|
end
|
||||||
|
|
||||||
|
fields = fieldnames(FileData);
|
||||||
|
fields = fieldnames(FileData);
|
||||||
|
for K = 1 : length(fields)
|
||||||
|
thisvar = fields{K};
|
||||||
|
thisdata = FileData.(thisvar);
|
||||||
|
if ~isnumeric(thisdata)
|
||||||
|
warning('Skipping field %s which is type %s instead of numeric', thisvar, class(thisvar))
|
||||||
|
else
|
||||||
|
if carSide == 'front'
|
||||||
|
thisfile = sprintf('Front_%s.csv', thisvar);
|
||||||
|
else
|
||||||
|
thisfile = sprintf('Rear_%s.csv', thisvar);
|
||||||
|
end
|
||||||
|
csvwrite(thisfile, thisdata);
|
||||||
|
end
|
||||||
|
end
|
||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user