I need to save the data from a .txt
file to open in excel. I can save the data, so that each loop is saved one below the other, but I can not save it in columns.
The first two columns are the same, what is different are the last two columns.
function:
for i = 1:9
vi = vi+(i+10-i);
misv = (C1.*(1-exp(-C2.*si))-C3.*si).*exp(-C4.*vi);
misvc = (C1.*(1-exp(-C2.*si))-C3.*si).*mi0.*exp(-C4.*vi);
TempA = [si; Fsi; misv; misvc];
FilenameA = strcat(Filename,' - Slip Function','.txt');
fid = fopen(FilenameA{1},'at+');
fprintf(fid, 'Slip Slip_Function Slip Slip_Function_Dry Slip_Function_Cont \n');
fprintf(fid,'------------------\n');
fprintf(fid,'%.3f %.3f %.3f %.3f\n',TempA);
fprintf(fid,'------------------\n');
fclose(fid);
File .txt
:
Slip Slip_Function Slip Slip_Function_Dry Slip_Function_Cont
------------------
0,000 0,000 0,000 0,000;
0,010 0,224 0,208 0,187;
0,020 0,399 0,370 0,333;
0,030 0,536 0,497 0,448;
0,040 0,643 0,597 0,537;
0,050 0,727 0,674 0,607;
Slip Slip_Function Slip Slip_Function_Dry Slip_Function_Cont
------------------
0,000 0,000 0,000 0,000;
0,010 0,224 0,193 0,173;
0,020 0,399 0,344 0,309;
0,030 0,536 0,461 0,415;
0,040 0,643 0,554 0,498;
0,050 0,727 0,626 0,563;