how can I store a set of segmented output images saved as individual mat files into a cell array
1 view (last 30 days)
Show older comments
some segmented images stored as matfile has ben given below. I need t store them into a cell array where each of its entries contain the individual mat files
0 Comments
Answers (1)
Adam Danz
on 5 Oct 2020
Edited: Adam Danz
on 6 Oct 2020
Set up your file names in an array such as
filenames = {'201080.mat', '201081.mat', '201082.mat', '201083.mat'}; % full path is better
Within a loop, load each file and store the data in a cell array.
C = cell(size(filenames));
for i = 1:numel(C)
data = load(filenames{i});
C{i} = data.finalColour;
end
where "finalColour" is the variable name in all mat files.
2 Comments
Adam Danz
on 8 Oct 2020
It's from the data you attached. It's a field name.
data.finalColour
See Also
Categories
Find more on Workspace Variables and MAT-Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!