octave-maintainers
[Top][All Lists]
Advanced

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

ezplot Matlab help


From: Rik
Subject: ezplot Matlab help
Date: Fri, 12 Jul 2013 12:10:19 -0700

7/12/13

All,

I'm re-writing the ez* series of functions and I'm trying to figure how
Matlab is massaging the function and axis limits in the ez* series as
opposed to the base functions.

First, do base functions like contour, mesh, and surf accept complex
inputs?  Octave completely fails on complex inputs.  Sample code:

[X, Y] = meshgrid (linspace (-2*pi, 2*pi, 60));
fh = @(x,y) sqrt (1 - x.^2 - y.^2);
Z = feval (fh, X, Y);
contour (X,Y,Z)
mesh (X,Y,Z)
surf (X,Y,Z)

If that works in Matlab, could someone determine how it is working?  Are
they plotting the magnitude of Z, i.e, abs(Z), or are they only plotting
that subsection of Z which is real and setting other Z data values to NaN?

Second, test is to determine the axis limits for surf plots.  What does the
following return

h = ezsurf (fh);
axis
xdata = get (h, 'xdata');
min (xdata(:))
max (xdata(:))

Third, test is to determine the axis limits for mesh plots.

fh = @(x,y) x.*exp(-x.^2-y.^2);
h = ezmesh(fh,40);
axis
xdata = get (h, 'xdata');
min (xdata(:))
max (xdata(:))

Thanks for any help on this,
Rik



reply via email to

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