I have multiple *.mat files. So the filename is generated in a loop as below:
File = ['hb', num2str(A(i)), '.mat'];
When I tried to load it by doing:
load File;
I got the below error:
Error using loadUnable to read file 'File': no such file or directory.Error in Combine_matfiles (line 17) load File;
I am 100% sure the generated filename, File is correct, and the file is right there in the same directory. I can open it by typing load with the file name in the command window without any problem.
What did I do wrong? Thanks.
Best Answer