Is there a way of getting a file name and inserting into Matlab script?
- by torr
In a folder, I have both my .m file that contains the script and an imaging .dcm file that needs to be analyzed.
Folder structure:
Folder1/analysis.m
Folder1/meas_dynamic_123.dcm
My script (analysis.m) begins as follows:
target =''; <== here should go the full path to the file + filename
example: /Volumes/Data/Folder1/meas_dynamic_123.m
txt = dir(target);
// etc
So I'm wondering if there is a way of when running analysis.m it will:
automatically search the folder it's in,
grab the full path + filename of file containing string dynamic in the name,
insert its full path + name into target variable
continue running the script
Does anyone have any pointers on how to achieve this? Using ffpath?