How to use writetable to write a file and save this file in the specific location

16 次查看(过去 30 天)
Hi all,
I have a structure and use struct2table to convert it as table, then use writetable function to generate a xlsx file, but my question is how to use writetable function to generate the file in the specific folder location, because my code (in the following) is always generate the file in the default location.
% Output the file
for i = 1 : size(M,2)
temp1 = M(i); %The number of columns of M
TYPE = temp1.type;
temp1 = rmfield(temp1,'type');
writetable(struct2table(temp1), 'New_file.xlsx', 'sheet', TYPE)
clearvars temp1
end
disp('Done!')
Could you please show me how to generate the file in an specific location, many thanks in advance for help!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by