what is the meaning for variable of .mat file
Ältere Kommentare anzeigen
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');
Akzeptierte Antwort
Weitere Antworten (2)
Soon Fei Fong
am 8 Mär. 2015
0 Stimmen
1 Kommentar
Image Analyst
am 8 Mär. 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
am 9 Mär. 2015
0 Stimmen
Kategorien
Mehr zu Read, Write, and Modify Image finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
