Displaying images by using a variable

10 ビュー (過去 30 日間)
Stephen Dheeraj
Stephen Dheeraj 2021 年 1 月 4 日
回答済み: Fangjun Jiang 2021 年 1 月 4 日
Actually my image names are numbers and image format is jpg I want to assign a variable and read the numbers into that variable How to read image and display image using that variable For eg:1.jpg is the image a=input('enter the number'); I am assigning 1 to it and want to display image 1.jpg using variable a. Can anyone respond and give a code to it??

採用された回答

Fangjun Jiang
Fangjun Jiang 2021 年 1 月 4 日
It can be done but less ideal.
a=input('enter the number','s');
file=[a,'.jpg'];
imshow(file);
Better
file=uigetfile('select a file');
imshow(file);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by