MATLAB: Strings

strings

Hey guys,
I would like to input a string and then ask matlab to save a series of data with the file name of already input string. e.g. if the string that is input in the starting point of program is analyzed_data1 how can I assign this string in file_name below? Supposedly that there are several save commands, it would help to avoid frequently typing analysed_data1 every time.
save(fullfile(path,'file_name'));
Thank you so much 🙂

Best Answer

Hi,
you are nearly there, I believe: suppose you write in your program at the top
myfilename = 'analysed_data1';
you just call save with
save(fullfile(path, myfilename));
Titus
PS: you might also want to take a look at uigetfile ...