Saving mat file named by a variable and comprising multiple variables to a different folder

1 vue (au cours des 30 derniers jours)
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?

Réponse acceptée

KL
KL le 16 Mai 2017
f = fullfile('myfolder','mysubfolder',char(PhID))
save(f,'PHdataOUT','TI','RawDataOutputArray')

Plus de réponses (0)

Catégories

En savoir plus sur Low-Level File I/O dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by