From: Jose on
Hello to everyone, can you help me with it:

I would like to plot a table x, y with the z values, where the square x=0.25 y = 0.25 correspond to z = 95. Thanks in advance.

x=[0.25 0.5 0.75 1]

y=[0.25 0.5 0.75 1]

z =

27 89 79 43
95 35 72 46
74 55 30 41
37 40 39 3
From: Walter Roberson on
Jose wrote:

> I would like to plot a table x, y with the z values, where the square
> x=0.25 y = 0.25 correspond to z = 95. Thanks in advance.
>
> x=[0.25 0.5 0.75 1]
>
> y=[0.25 0.5 0.75 1]
>
> z =
>
> 27 89 79 43
> 95 35 72 46
> 74 55 30 41
> 37 40 39 3

surf(x,y,z)

or use bar3() or pcolor()
From: Roger Stafford on
"Jose " <jose.l.vega(a)gmail.com> wrote in message <hsrk6o$b1f$1(a)fred.mathworks.com>...
> Hello to everyone, can you help me with it:
>
> I would like to plot a table x, y with the z values, where the square x=0.25 y = 0.25 correspond to z = 95. Thanks in advance.
>
> x=[0.25 0.5 0.75 1]
>
> y=[0.25 0.5 0.75 1]
>
> z =
>
> 27 89 79 43
> 95 35 72 46
> 74 55 30 41
> 37 40 39 3
- - - - - - - -
You first need to make meshes of x and y. Use

[X,Y] = meshgrid(x,y);

if x is understood to vary along the rows of z, or

[Y,X] = meshgrid(y,x);

if x varies along the columns of z. Then do

surf(X,Y,z)

Roger Stafford
From: Walter Roberson on
Roger Stafford wrote:
> "Jose " <jose.l.vega(a)gmail.com> wrote in message

>> x=[0.25 0.5 0.75 1]
>> y=[0.25 0.5 0.75 1]

> You first need to make meshes of x and y. Use

> if x varies along the columns of z. Then do
> surf(X,Y,z)

surf is happy to accept vectors for x and y.

SURF(x,y,Z) and SURF(x,y,Z,C), with two vector arguments replacing
the first two matrix arguments, must have length(x) = n and
length(y) = m where [m,n] = size(Z). In this case, the vertices
of the surface patches are the triples (x(j), y(i), Z(i,j)).
Note that x corresponds to the columns of Z and y corresponds to
the rows.
From: Roger Stafford on
Walter Roberson <roberson(a)hushmail.com> wrote in message <IwdIn.14229$0M5.11061(a)newsfe07.iad>...
> surf is happy to accept vectors for x and y.

You're right, Walter. I forgot about that provision.

Roger Stafford