MATLAB绘图

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函数均与 图形句柄的操作有关

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值