how to read images stored in mat files using variables

13 ビュー (過去 30 日間)
Lakshmi
Lakshmi 2013 年 8 月 2 日
コメント済み: Walter Roberson 2017 年 11 月 9 日
I have a set of images stored in mat file. In the program I have a variable using which i need to the corresponding image file in mat.
For Example :
I = imread('1.jpg');
J = imread('2.jpg');
save imgs.mat
a = 'I';
imshow(a); --- this should get the image I from mat file displayed. But I am getting the error message
Cannot find the specified file: "I"
How to do this ?

採用された回答

Walter Roberson
Walter Roberson 2013 年 8 月 2 日
input_data = load('imgs.mat', a);
imshow(input_data.(a))
  3 件のコメント
Melaku Eneayehu
Melaku Eneayehu 2017 年 11 月 7 日
Undefined function or variable 'a'
Walter Roberson
Walter Roberson 2017 年 11 月 9 日
The user had done,
a = 'I';

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by