saving files in a folder
15 ビュー (過去 30 日間)
古いコメントを表示
Kofi Agyemang Amankwah
2023 年 6 月 11 日
コメント済み: Kofi Agyemang Amankwah
2023 年 6 月 11 日
I am trying to save some data named (cn,y,z) into the directory with folder, vfolder. I expect the file (cn,y,z) to be contained in Pzz5X10. I keep getting errors anytime I run the code below. Any help will be appreciated.
Thanks.
zz = '10';
f = '5';
vfolder = pwd;
save([vFolder,'\' 'Pzz'+f+'X'+zz.mat'],'cn','y','z');
0 件のコメント
採用された回答
Stephen23
2023 年 6 月 11 日
save([vFolder,'\' 'Pzz'+f+'X'+zz.mat'],'cn','y','z');
% ^^^^^^^ invalid syntax
Better:
fnm = sprintf('Pzz%dX%d.mat',5,10);
save(fullfile(vFolder,fnm),'cn','y','z')
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!