Re: display a matrix with a gray-scale graph
- From: Adam Chapman <adam.chapman@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 2 Dec 2007 06:30:33 -0800 (PST)
On Dec 2, 1:29 pm, "piglet " <piglet....@xxxxxxxxxxxxx> wrote:
Hi,
I am going to display a matrix with a gray-scale graph. For
example, a matrix A is defined as:
0.5 0.2 0.3
0.2 0.3 0.6
I need to draw a box with 2 rows and 3 columns, the
gray-scale of each cell is just the value of the element,
e.g., the gray-scale of the cell c(1,2) is the value of A(1,2).
-------------------
| |c(1,2)| |
-------------------
| | | |
-------------------
Is there anyone kindly giving me some suggestions? Many thanks!
A=[0.5, 0.2, 0.3; 0.2, 0.3, 0.6];
imshow(A,[])
would work by drawing your grayscale box, but the image would be very
small because each value is displayed as a single pixel.
A(1:100,1:100)=0.5;
A(1:100,101:200)=0.2;
A(1:100,201:300)=0.3;
A(101:200,1:100)=0.2;
A(101:200,101:200)=0.3;
A(101:200,201:300)=0.6;
imshow(A)
would displayit much larger.
Adam
.
- References:
- display a matrix with a gray-scale graph
- From: piglet
- display a matrix with a gray-scale graph
- Prev by Date: Re: (ask) cubic spline interpolation problem
- Next by Date: numerical integration and polar coordinates
- Previous by thread: display a matrix with a gray-scale graph
- Next by thread: Re: display a matrix with a gray-scale graph
- Index(es):
Relevant Pages
|