saving files in a folder
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kofi Agyemang Amankwah
am 11 Jun. 2023
Kommentiert: Kofi Agyemang Amankwah
am 11 Jun. 2023
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 Kommentare
Akzeptierte Antwort
Stephen23
am 11 Jun. 2023
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')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu File Operations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!