I have many files in a folder named "mat_files". What I want to do is to load the files and get their values. Below is my code:
a = dir('mat_files');for i = 3:length(a); filename = a(i).name; load strcat('mat_files/', filename);end;
This is the error:
Error using loadUnable to read file 'filename': no such file or directory.
When I type a(3).name in the command window, I get the correct filename of "ex0219.mat". Of course, I can load the data by typing "load ex0219.mat". Clearly load a(3).name does not work. I also tried load (a(3).name), which does not work either.
Best Answer