이전: , 상위 문서: High-Level Plotting   [차례][찾아보기]


15.2.11 Test Plotting Functions

The functions sombrero and peaks provide a way to check that plotting is working. Typing either sombrero or peaks at the Octave prompt should display a three-dimensional plot.

sombrero ()
sombrero (n)
z = sombrero (…)
[가로, 세로, z] = sombrero (…)

Plot the familiar 3-D sombrero function.

The function plotted is

z = sin (sqrt (x^2 + y^2)) / (sqrt (x^2 + y^2))

Called without a return argument, sombrero plots the surface of the above function over the meshgrid [-8,8] using surf.

If n is a scalar the plot is made with n grid lines. The default value for n is 41.

When called with output arguments, return the data for the function evaluated over the meshgrid. This can subsequently be plotted with surf (가로, 세로, z).

같이 보기: peaks, meshgrid, mesh, surf.

peaks ()
peaks (n)
peaks (가로, 세로)
z = peaks (…)
[가로, 세로, z] = peaks (…)

Plot a function with lots of local maxima and minima.

The function has the form

f(x,y) = 3*(1-x)^2*exp(-x^2 - (y+1)^2) ...
         - 10*(x/5 - x^3 - y^5)*exp(-x^2-y^2) ...
         - 1/3*exp(-(x+1)^2 - y^2)

Called without a return argument, peaks plots the surface of the above function using surf.

If n is a scalar, peaks plots the value of the above function on an n-by-n mesh over the range [-3,3]. The default value for n is 49.

If n is a vector, then it represents the grid values over which to calculate the function. If 가로 and 세로 are specified then the function value is calculated over the specified grid of vertices.

When called with output arguments, return the data for the function evaluated over the meshgrid. This can subsequently be plotted with surf (가로, 세로, z).

같이 보기: sombrero, meshgrid, mesh, surf.


이전: , 상위 문서: High-Level Plotting   [차례][찾아보기]