help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to save matrix as image?


From: Andy Buckle
Subject: Re: How to save matrix as image?
Date: Mon, 12 Sep 2011 15:22:30 +0100

On 12 September 2011 02:06, Terry Duell <address@hidden> wrote:
> Hullo All,
> This should be simple enough, I have been doing it for a lot of the data I'm
> working with, but have been unable to to so with a particular matrix.
> I have a matrix (D1, 1209x1559x2) which I want to save out as a greyscale
> image using,
>  'imwrite(mat2gray(D1),'results/D1_concatderiv.jpg');'
> which gives me the error;
> 'error: mat2gray: mx_el_lt: nonconformant arguments (op1 is 1209x1559x2, op2
> is 1x1x2)'
> I thought I had done this on other occasions, but obviously not.
> What am I missing?
>
> Regards,
> Terry Duell

As D1 is 1209x1559x2, it probably cannot tell if it should use (:,:,1)
or (:,:,2) for the gray values. I guess this might work

imwrite(mat2gray(D1(:,:,1)),'results/D1_concatderiv.jpg');

This may not be what you want, of course. I see that "help mat2gray"
could do with some work.

-- 
/* andy buckle */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]