Hi, I have several mat files in different directory, the names are organized in the following manner
"Coluomb_Torque_XX_Speed_YY" where XX = 1:29 and YY=1:31;
the problem when I create a nested loop and try to load the files by their full name (including the subdirectories), I get an error regarding the index. I appreciate anyone's help
clear
clc
XX=1:29;
YY=1:31;
for q=1:length(XX)
for p=1:length(YY)
ff='Coluomb_';
tt='Torque_';
uu='_Ratio_';
qq=num2str(q);
pp=num2str(p);
filename=[ff,tt,qq,uu,pp];
filename = ['C:\Users\folder1\folder2\folder3\folder4\Data Generating\Coluomb\' filename]
load(filename)
end
end
The error am getting is :
Error using load
Unable to read file
'C:\Users\folder1\folder2\folder3\folder4\DataGenerating\Coluomb\. No such file or
directory.
Error in post_proc (line 18)
load(filename)
as you can see, the loop keeps going beyond the index 29, and this happens only when I use the Load command, i.e if I remove the load command I get the filenames exactly as they should be.
Thanks
Alz