How to display an image from output value?

4 views (last 30 days)
Hi, I have A=37 after some process and I need to display '37.jpg' which is present in my database.I gave imshow('A.jpg').But it says A.jpg does not exist.I can't give imshow(37.jpg)Because I need to do the same process for 1000 times so 'A' value gets changed every time. How do I display the image

Accepted Answer

Friedrich
Friedrich on 4 Mar 2013
Hi,
try num2str:
A = 37
imshow([num2str(A),'.jpg'])
  2 Comments
maha lakshmi
maha lakshmi on 4 Mar 2013
Thank you sir,it works.If 'A' has some 4 values like 25,3,65,47.How do i display more than one image at a time.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!