save work space variables into excel sheet headlines and columns
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I have a lone code with about 7 variables Im trying to save into excel sheet with the variables names as headline and the data into the column of that headline. all the varables are matrix 20x1 and the names are listed below.
r_coords
extracted_data
r_exper
V_exper
V_interpolation
Absuolut_Error
Relative_Error
filename = (sprintf('monitor_line_%d_ degree %.1fCA_%s', Monitor_line, CrankAngle, upper(variable)));
Results_Names={'r_coords','extracted_data','r_exper','V_exper','V_interpolation','Absuolut_Error','Relative_Error'};
Results_Values=[r_coords,extracted_data,r_exper,V_exper,V_interpolation,Absuolut_Error,Relative_Error];
sheet=1;
xlswrite('filename.xlsx',Results_Values,sheet);
1 件のコメント
回答 (1 件)
Voss
2024 年 1 月 2 日
One way to write the file:
C = [Results_Names; num2cell(Results_Values)];
writecell(C,filename)
Another way to write the file:
T = array2table(Results_Values,'VariableNames',Results_Names);
writetable(T,filename)
Another (not recommended) way to write the file:
sheet=1;
C = [Results_Names; num2cell(Results_Values)]
xlswrite(filename,C,sheet);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!