MATLAB Answers

BANI tita

how to display an image from a matrix in matlab?

Asked by BANI tita
on 24 Dec 2012

Hello, I am looking for the matlab function that allows me to transfer a confusion matrix has a picture, thank you




No products are associated with this question.

2 Answers

Answer by Image Analyst
on 24 Dec 2012

Use image(), or imshow() (in the Image Processing Toolbox). If it's a floating point image, you need to use imshow(yourImage, []).


thank you for your answer but I'm looking to transform a confusion matrix to an image, and function you my data is just to display an image.

There is no difference to MATLAB between an "image matrix" and a "data matrix". It is all just data. Use imagesc(YourMatrix) or imshow(YourMatrix,[])

thank you

Answer by Maurizio De Pitta' on 25 Dec 2012


will solve your issue.



  1 Comment

By default, imagesc applies some weird colormap that's almost never what you want. Then you have to apply the correct colormap, like gray or whatever. That's why I avoid it and use imshow instead, which applies no colormap - it's just the normal gray scale colormap for a gray scale image.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!