フィルターのクリア

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

13 ビュー (過去 30 日間)
Chao Zhang
Chao Zhang 2021 年 11 月 23 日
コメント済み: Chao Zhang 2021 年 11 月 23 日
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!
  2 件のコメント
dpb
dpb 2021 年 11 月 23 日
See the documentation/examples at
doc fullfile
Chao Zhang
Chao Zhang 2021 年 11 月 23 日
Thank you! I can accept your answer if you put your comments in answer, cheers!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by