Prev: Results not repeatable for sum() function on fixed / deterministic vector
Next: combining subplots
From: Bryant on 5 Apr 2010 15:15 I need a way to display an image made up of defined x and y coordinates where each (x,y) corresponds to a specific color which is defined in another matrix. So there's a matrix for the x values, a matrix for the y values, and a matrix for the colors.
From: us on 5 Apr 2010 15:17 On Apr 5, 9:15 pm, "Bryant " <rabid_bunn...(a)yahoo.com> wrote: > I need a way to display an image made up of defined x and y coordinates where each (x,y) corresponds to a specific color which is defined in another matrix. So there's a matrix for the x values, a matrix for the y values, and a matrix for the colors. a hint: help scatter; us
From: ImageAnalyst on 5 Apr 2010 15:52 On Apr 5, 3:15 pm, "Bryant " <rabid_bunn...(a)yahoo.com> wrote: > I need a way to display an image made up of defined x and y coordinates where each (x,y) corresponds to a specific color which is defined in another matrix. So there's a matrix for the x values, a matrix for the y values, and a matrix for the colors. ---------------------------------- Maybe a for loop, like this untested code: rows = max(y); columns = max(x); rgbImage = zeros(rows, columns, 3); for k= 1 : length(x) row = x(k); col = y(k); rgbImage(row, col, 1) = colorMatrix(k, 1); rgbImage(row, col, 2) = colorMatrix(k, 2); rgbImage(row, col, 3) = colorMatrix(k, 3); end imshow(rgbImage); Of course there may be some pixels that don't get assigned any value but you would know that from what x's and y's you included.
From: Bryant on 5 Apr 2010 15:53 us <us(a)neurol.unizh.ch> wrote in message <5e01d9a3-38f4-4437-86da-c34c88f41014(a)u22g2000yqf.googlegroups.com>... > On Apr 5, 9:15 pm, "Bryant " <rabid_bunn...(a)yahoo.com> wrote: > > I need a way to display an image made up of defined x and y coordinates where each (x,y) corresponds to a specific color which is defined in another matrix. So there's a matrix for the x values, a matrix for the y values, and a matrix for the colors. > > a hint: > > help scatter; > > us It's supposed to be gridded, like each point is a pixel
From: Steven Lord on 5 Apr 2010 17:59 "Bryant " <rabid_bunnies(a)yahoo.com> wrote in message news:hpdf31$87g$1(a)fred.mathworks.com... > us <us(a)neurol.unizh.ch> wrote in message > <5e01d9a3-38f4-4437-86da-c34c88f41014(a)u22g2000yqf.googlegroups.com>... >> On Apr 5, 9:15 pm, "Bryant " <rabid_bunn...(a)yahoo.com> wrote: >> > I need a way to display an image made up of defined x and y coordinates >> > where each (x,y) corresponds to a specific color which is defined in >> > another matrix. So there's a matrix for the x values, a matrix for the >> > y values, and a matrix for the colors. >> >> a hint: >> >> help scatter; >> >> us > > It's supposed to be gridded, like each point is a pixel > SCATTER can accept any marker specifications PLOT can, and one of the specifications is 's' for square: scatter(1:10, 1:10, 's') Alternately, look at PCOLOR. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
|
Pages: 1 Prev: Results not repeatable for sum() function on fixed / deterministic vector Next: combining subplots |