Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: creating an image
Date: Fri, 22 May 2009 18:45:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 26
Message-ID: <gv6rrg$lk3$1@fred.mathworks.com>
References: <gv6oo2$6t$1@fred.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243017904 22147 172.30.248.38 (22 May 2009 18:45:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 22 May 2009 18:45:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:541877


If the values are intensities, you need a 2D matrix 

im2D

which will satisfy:

im2D(x,y) = value;

But if you are going to use color, then you could have a 3D matrix satisfying:

im3D(x,y,1) = redValue;
im3D(x,y,2) = greenValue;
im3D(x,y,3) = blueValue;

where value = [redValue,greenValue,blueValue];


"Dominic " <dom_awf@hotmail.com> wrote in message <gv6oo2$6t$1@fred.mathworks.com>...
> Hi,
> 
> I have a struct with struct.x, struct.y and struct.value and want to create an image, where (struct.x,struct.y) represent the pixel and the value is interpreted as color or intensity in grey scale. 
> 
> Is it better to have an 3D Array or doesn't it matter. The size of the picture is usually 512x512.
> 
> cheers,
> Dominic