help-octave
[Top][All Lists]
Advanced

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

Re: 3D plot from a matrix


From: Przemek Klosowski
Subject: Re: 3D plot from a matrix
Date: Thu, 15 May 2014 09:55:10 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/15/2014 06:09 AM, guido.bonalumi wrote:
I want to generate a 3D plot from a matrix but I do not know how to do it.
The matrix (30x13) contains the Z values that I want to plot, but this
values are not equally spaced:
- in the X direction I have 30 step of data which I can consider equally
spaced, but I want a scale from 0 to 1 on this axis (it represent a non
dimensional coordinate);
- in the Y direction the coordinates are from 0 to 67.9 but these values are
not equally spaced (0, 6.8, 13.6, 20.4, 27.2, 34, 40.7, 47.5, 52.1, 56.6,
61.1, 65.6, 67.9); still I want the same scale as the X axis (from 0 to 1).
m=zeros(30,13) ;  # your 30x13 data goes here
y=[0, 6.8, 13.6, 20.4, 27.2, 34, 40.7, 47.5, 52.1, 56.6,61.1, 65.6, 67.9];
[xx,yy]=meshgrid(y/max(y), linspace(0,1,30));
surface(xx,yy,m)



reply via email to

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