Effacer les filtres
Effacer les filtres

Unable to read MATLAB figure file *.fig in imread. The error is unable to determine file format.

16 vues (au cours des 30 derniers jours)
I am trying to make a movie for saved images in my working directory. The images (mesh plots) are named as H100, H200, ..., H2000. The file format of these images is *.fig. (H100.fig, H200.fig,...). I am running the following script to make the movie. I took this script from another post in an online help forum and trying to make it work for my problem.I am not familiar with movie making in MATLAB as it is my first attempt to make a movie for my plotted results.
images = cell(20,1);
I=100:100:2000;
for i=1:20
images{i}=imread(sprintf('H%d.fig',I(i)));
end
writerObj = VideoWriter('Concentration.avi');
writerObj.FrameRate = 30;
open(writerObj);
for u=1:20
frame = im2frame(images{u});
writeVideo(writerObj, frame);
end
close(writerObj);
implay('Concentration.avi');
When I change the file format to *.jpg, it runs fine. It is not possible for me to change the file format for each of the image. I am unable to make it work for my problem. Any help will be highly appreciated. Thanks.

Réponse acceptée

Star Strider
Star Strider le 29 Oct 2018
To read ‘.fig’ files, use the openfig (link) function, not imread.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by