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)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
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.
2 comentarios
Adam Danz
el 8 de Oct. de 2020
It's from the data you attached. It's a field name.
data.finalColour
Ver también
Categorías
Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!