Saving mat file named by a variable and comprising multiple variables to a different folder
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Stephen Devlin
am 16 Mai 2017
Kommentiert: Stephen Devlin
am 16 Mai 2017
Hi,
I have spent a few hours now trying to get my head around a problem that seems simple but the implementation is eluding me. I run a long script which creates some variables I wish to save for further work with another script. The input data files I use to extract a filename, which I want to use to name the mat file I create, this I can do no problem, just I want to save it to a different folder within the same script. I have looked at full file and save documentation and numerous close but not quite answers on here.
%this what I use to save the mat file
save(char(PhID),'PHdataOUT','TI','RawDataOutputArray')
%it gives me a mat file correctly titled and comprises the three variables %'PHdataOUT','TI','RawDataOutputArray'
The path i want is something like '/Users/mainfolder/Desktop/subfolder/database/' but i cannot figure out how to adapt either file parts or full file to get this mat file where it needs to go. Any ideas?
0 Kommentare
Akzeptierte Antwort
KL
am 16 Mai 2017
f = fullfile('myfolder','mysubfolder',char(PhID))
save(f,'PHdataOUT','TI','RawDataOutputArray')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Workspace Variables and MAT Files 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!