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: Andy Buckle
Subject: Re: 3D plot from a matrix
Date: Thu, 15 May 2014 15:35:07 +0100




On 15 May 2014 14:37, guido.bonalumi <address@hidden> wrote:
Thank you for the tips... Can you be more specific about what your code does?
In particular I am interested in these three lines:

/ [XX YY]=meshgrid(X,Y);
 Z=XX.^2+YY.^2; %dummy data to plot.
 surf(XX,YY,Z)/

Thanks again!

surf does the plotting. meshgrid takes a 1D array for each of X and Y and makes a 2D array. XX, YY and Z then all have the same number of rows and columns. corresponding positions in those arrays give the X,Y and Z coordinates. This is required by the 3D plotting functions. It's also handy for me to generate a function of 2 variables, Z, because I don't have your data. For more info on the functions type the following into octave

help meshgrid
help surf


--
/* andy buckle */

reply via email to

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