I am using this code to convert .jpg file to maltab .fig but in matlab lab file there is no figure represented and if I want to convert more than one .jpg files to fig how can I. I am attaching two files

3 次查看(过去 30 天)
img = imread('~~.jpg');
imshow(img);
savefig('~~~.fig');
  5 个评论

请先登录,再进行评论。

回答(2 个)

KSSV
KSSV 2018-5-29
images = dir('*.jpg') ;
N = length(images) ;
% loop for each image
for i = 1:N
I = imread(images(i).name) ;
[filepath,name,ext] = fileparts(images(i).name) ;
imshow(I) ;
savefig([name,'.fig']);
end
  6 个评论

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2018-5-30
Look in the File Exchange and search for tag:digitize as I have marked a number of routines designed to extract plot information from images.
It would be much easier to extract the data before you wrote them as .jpg files.

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by