Path = 'D:\50-350\';
File = dir( fullfile(Path,'*.dat'));
FileNames = {File.name}';
Length_Names = size(FileNames,1);
for i=1:Length_Names
filename=strcat(Path, FileNames(i));
eval(['Data',num2str(i),'=','load(filename{1,1})',';']);
end
I have 3 targets here:
1、Find out all the files with '.dat' in folder '50-350';
2、Read the data;
2、Rename the data from ‘Data1 Data2 Data3 Data4...’ one by one;
By the codes above, I successfuly achieve the goals, but I find that the size of the data change.
For example: I load the ' 31.dat ' by the above codes, and rename it as ' Data31'. The size of Data31 is 3353×10 . If I read '31.dat' directly, the size is 2501×10. I am wonder why it happened.