what is the meaning for variable of .mat file
Mostrar comentarios más antiguos
Hi, I have two colour image in .jpg. How can I convert them into 1 .mat file with only 1 variable like 2x28x28 array.
here is the code that i have try, but it generate 2 variable as below

- pic1 = imread('image_0001.jpg');
- pic1 = imresize(pic1, [28, 28]);
- pic2 = imread('image_0002.jpg');
- pic2 = imresize(pic2, [28, 28]);
- save('BothPics.mat', 'pic1', 'pic2');
Respuesta aceptada
Más respuestas (2)
Soon Fei Fong
el 8 de Mzo. de 2015
0 votos
1 comentario
Image Analyst
el 8 de Mzo. de 2015
You can save things in a structure array and save that.
allImages(1).pic = pic1;
allImages(2).pic = pic2;
% and so on...
save('mydata.mat', 'allImages')
Soon Fei Fong
el 9 de Mzo. de 2015
0 votos
Categorías
Más información sobre Read, Write, and Modify Image en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
