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 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