Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
17
Добавлен:
09.02.2015
Размер:
500.22 Кб
Скачать

If your function has additional parameters, for example k in myfun:

%-----------------------%

function z = myfun(x,y,k)

z = - x.^k - y.^k;

%-----------------------%

then you may use an anonymous function to specify that parameter:

ezmeshc(@(x,y)myfun(x,y,2))

See also ezplot, ezplot3, ezpolar, ezcontour, ezcontourf, ezmesh,

ezsurf, ezsurfc, meshc, vectorize, function_handle.

Overloaded methods:

sym/ezmeshc

Reference page in Help browser

doc ezmeshc

<ezplot3> - Easy to use 3-D parametric curve plotter.

EZPLOT3 Easy to use 3-d parametric curve plotter

EZPLOT3(FUNX,FUNY,FUNZ) plots the spatial curve FUNX(T), FUNY(T), and

FUNZ(T) over the default domain 0 < T < 2*PI.

EZPLOT3(FUNX,FUNY,FUNZ,[TMIN,TMAX]) plots the curve FUNX(T), FUNY(T),

and FUNZ(T) over TMIN < T < TMAX.

EZPLOT3(FUNX,FUNY,FUNZ,'animate') or

EZPLOT(FUNX,FUNY,FUNZ,[TMIN,TMAX],'animate') produces an animated trace

of the spatial curve.

EZPLOT3(AX,...) plots into AX instead of GCA.

H = EZPLOT3(...) returns handles to the plotted objects in H.

Examples:

The easiest way to express a function is via a string:

ezplot3('cos(t)','t*sin(t)','sqrt(t)')

One programming technique is to vectorize the string expression using

the array operators .* (TIMES), ./ (RDIVIDE), .\ (LDIVIDE), .^ (POWER).

This makes the algorithm more efficient since it can perform multiple

function evaluations at once.

ezplot3('cos(t)','t.*sin(t)','sqrt(t)')

You may also use a function handle to an existing function or an

anonymous function. These are more powerful and efficient than string

expressions.

ezplot3(@cos,@(t)t.*sin(t),@sqrt)

If your function has additional parameters, for example k in myfuntk:

%-----------------------%

function s = myfuntk(t,k)

s = t.^k .* sin(t);

%-----------------------%

then you may use an anonymous function to specify that parameter:

ezplot3(@cos,@(t)myfuntk(t,1),@sqrt)

See also ezcontour, ezcontourf, ezmesh, ezmeshc, ezplot, ezpolar,

ezsurf, ezsurfc, plot, plot3, vectorize, function_handle.

Overloaded methods:

sym/ezplot3

Reference page in Help browser

doc ezplot3

<ezsurf> - Easy to use 3-D colored surface plotter.

EZSURF Easy to use 3-D colored surface plotter

EZSURF(FUN) plots a graph of the function FUN(X,Y) using SURF. FUN is

plotted over the default domain -2*PI < X < 2*PI, -2*PI < Y < 2*PI.

EZSURF(FUN,DOMAIN) plots FUN over the specified DOMAIN instead of the

default domain. DOMAIN can be the vector [XMIN,XMAX,YMIN,YMAX] or the

vector [A,B] (to plot over A < X < B, A < Y < B).

EZSURF(FUNX,FUNY,FUNZ) plots the parametric surface FUNX(S,T),

FUNY(S,T), and FUNZ(S,T) over the square -2*PI < S < 2*PI and

-2*PI < T < 2*PI.

EZSURF(FUNX,FUNY,FUNZ,[SMIN,SMAX,TMIN,TMAX]) or

EZSURF(FUNX,FUNY,FUNZ,[A,B]) uses the specified domain.

EZSURF(...,N) plots f over the default domain using an N-by-N grid.

The default value for N is 60.

EZSURF(...,'circ') plots f over a disk centered on the domain.

EZSURF(AX,...) plots into AX instead of GCA.

H = EZSURF(...) returns a handle to the surface object in H.

Examples:

The easiest way to express a function is via a string:

ezsurf('x*exp(-x^2 - y^2)')

One programming technique is to vectorize the string expression using

the array operators .* (TIMES), ./ (RDIVIDE), .\ (LDIVIDE), .^ (POWER).

This makes the algorithm more efficient since it can perform multiple

function evaluations at once.

ezsurf('x.*exp(-x.^2 - y.^2)')

You may also use a function handle to an existing function. Function

handles are more powerful and efficient than string expressions.

ezsurf(@peaks)

EZSURF plots the variables in string expressions alphabetically.

subplot(1,2,1), ezsurf('u.*(v.^2)./(u.^2 + v.^4)')

To avoid this ambiguity, specify the order with an anonymous function:

subplot(1,2,2), ezsurf(@(v,u)u.*(v.^2)./(u.^2 + v.^4))

Соседние файлы в папке Библиотеки Matlab