for m = 1:length(lst_region)
out=cellfun(@(x) str2double(x(1:strfind(x,'_')-1)),lst_region(m));
str=[num2str(out(1)) '.mat'];
save ( str ,distance);
end
Error using save Argument must contain a string. Line 3
I want to save files like '1.mat' '2.mat' etc.. but i have error can you please help me to fix it
If
distance
is a variable in your workspace, you will have to callsave(str, 'distance');
. You have to enter the name of the variable, not the variable itself.