how to read images stored in mat files using variables

13 visualizaciones (últimos 30 días)
Lakshmi
Lakshmi el 2 de Ag. de 2013
Comentada: Walter Roberson el 9 de Nov. de 2017
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 ?

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Ag. de 2013
input_data = load('imgs.mat', a);
imshow(input_data.(a))
  3 comentarios
Melaku Eneayehu
Melaku Eneayehu el 7 de Nov. de 2017
Undefined function or variable 'a'

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by