how can I store a set of segmented output images saved as individual mat files into a cell array

1 view (last 30 days)
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

Answers (1)

Adam Danz
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.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!