Reputation: 143
Previous .mat
file reading questions have been looked at, this is a little more specific so please bear with me.
I have a large dataset of files named:
int_f0270.mat
int_f0271.mat
...
These are image matrices that I need to read into MATLAB so that I can perform sequential operations on them. The code I am using is below:
for i = 270:273
filename = strcat('int_f0',int2str(i),'.mat');
load(filename);
end
This works for the first file (e.g. int_f0271.mat
), but fails to load any more .mat files into picture.
The only output I get is this:
which is the correct size and can be displayed as an image but I need this for all my data set. Any help would be greatly appreciated.
Upvotes: 0
Views: 135
Reputation: 4336
ImageCell = {};
for i = 270:273
filename = strcat('int_f0',int2str(i),'.mat');
load(filename);
ImageCell{i-269} = C;
clear C
end
Upvotes: 2