Skip to content

Instantly share code, notes, and snippets.

@embedded4ever
Last active November 5, 2018 13:44
Show Gist options
  • Save embedded4ever/90eb553da82b04d88fa623ad87eacc6f to your computer and use it in GitHub Desktop.
Save embedded4ever/90eb553da82b04d88fa623ad87eacc6f to your computer and use it in GitHub Desktop.
Load .mat file and save image as png in matlab
%open .mat file and saveas .png in matlab
% you must edit load(sprintf('%d.mat',i))
% i have file like 1.mat , 2.mat , 3.mat ,4.mat ,5.mat ,6.mat
for i=1:6
load(sprintf('%d.mat',i))
x = cjdata.image;
imshow (x,maps);
h=figure(1);
saveas(h,sprintf('%d.png',i));
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment