MATLAB: Creating .mat file

image processing

Sir I have 15 images ,I want to create .mat file so that i can load these images easily,please tell how to create .mat file

Best Answer

1.) If the images are the same size you can put them in an array and save that. If different, use a cell array.
2.) You can use matfile() to create a writable .mat file, save data into it, and then load that.
matobj = matfile('c:\data\mymat','Writable',true);
matobj.image1 = randn(256,256);
matobj.image2 = randn(256,256);
loadimage1 = matobj.image1;
% or
load('mymat.mat','image1');
Related Question