I am trying to save a file (preferably .mat) every time a loop is finished. The following throws an error: for j = 1:2; do lots of stuff; filename = ['X',num2str(j),'.mat']; save(filename,variable); end
Apparently filename is char rather than string; but when I try instead: for j = 1:2; do lots of stuff; filename = ['X',num2str(j),'.mat']; save(string(filename),variable); end
Matlab says string is obsolete! No way out so far…. any help for this seemingly innocuous issue greatly appreciated.
Best Answer