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

1 visualización (últimos 30 días)
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

Respuestas (1)

Adam Danz
Adam Danz el 5 de Oct. de 2020
Editada: Adam Danz el 6 de Oct. de 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.

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by