1.fplot可用来精确绘图
例如
sn = @(x) sin(1./x);
fplot(sn,[0.01,0.1])
或者
Create a file named myfun.m that containsthe following code.
function Y = myfun(x)
Y(:,1) = 200*sin(x(:))./x(:);
Y(:,2) = x(:).^2;
Then, create a function handle pointing to myfun.
fh = @myfun;
Plot the function from -20 to 20.
fplot(fh,[-20 20])
2.ezplot用来绘制一元函数
For an implicit function, fun2(x,y):
ezplot(fun2) plots fun2(x,y)= 0 over the default domain -2π < x <2π, -2π < y < 2π.
ezplot(fun2,[xymin,xymax]) plots fun2(x,y)= 0 over xymin < x < xymax and xymin < y < xymax.
ezplot(fun2,[xmin,xmax,ymin,ymax]) plots fun2(x,y)= 0 over xmin < x < xmax and ymin < y < ymax.
For Example
fh = @(x,y) sqrt(x.^2 + y.^2 - 1);
ezplot(fh)
axis equal
3.ezmesh绘制二元函数
ezmesh(fun,domain) plots fun overthe specified domain. domain canbe either a 4-by-1 vector [xmin, xmax, ymin, ymax]or a 2-by-1 vector [min, max](where min < x < max, min < y < max).
ezmesh(funx,funy,funz) plotsthe parametric surface funx(s,t), funy(s,t),and funz(s,t) over the square: -2π < s <2π, -2π < t < 2π.
ezmesh(funx,funy,funz,[smin,smax,tmin,tmax]) or ezmesh(funx,funy,funz,[min,max]) plots theparametric surface using the specified domain.
This example visualizes the function
with a mesh plot drawn on a 40-by-40 grid. The mesh lines areset to a uniform blue color by setting the colormap to a single color:
fh = @(x,y) x.*exp(-x.^2-y.^2);
ezmesh(fh,40)
colormap([0 0 1])
*****************************************************************************************************************************************************************************************
handle=figure()获得图形句柄
figure(handle)对句柄为handle的图形窗口进行操作
set,get函数均与 图形句柄的操作有关