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

Thread Subject:
save a matrix as a figure preserving its type

Subject: save a matrix as a figure preserving its type

From: Javier

Date: 3 Jul, 2012 09:42:09

Message: 1 of 3

Hi, I have a matrix in double format that contains an image and I want to save it as an image. The problem is that when I use the function imwrite(A,'OUTPUT','bmp') the resulting image is white with black points, not my image.
I have also tried with 'export_fig('-bmp','-native') but when I read it, the matrix is uint8.

How could I save a matrix as a figure preserving its type?

Thank you very much

Subject: save a matrix as a figure preserving its type

From: Sadik

Date: 3 Jul, 2012 21:39:15

Message: 2 of 3

Hi Javier,

You can write it in ANALYZE format [as two files HDR and IMG].

Probably you can start from here:

http://www.mathworks.com/matlabcentral/fileexchange/8797

Best.

Subject: save a matrix as a figure preserving its type

From: Bruno Luong

Date: 3 Jul, 2012 22:15:07

Message: 3 of 3

"Javier " <javsanzperez@gmail.com> wrote in message <jsueph$277$1@newscl01ah.mathworks.com>...
> Hi, I have a matrix in double format that contains an image and I want to save it as an image. The problem is that when I use the function imwrite(A,'OUTPUT','bmp') the resulting image is white with black points, not my image.
> I have also tried with 'export_fig('-bmp','-native') but when I read it, the matrix is uint8.
>
> How could I save a matrix as a figure preserving its type?

What's wrong with using MATLAB SAVE command?

Bruno

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us