matlab课件第三章.ppt

上传人:牧羊曲112 文档编号:6512165 上传时间:2023-11-08 格式:PPT 页数:30 大小:6.48MB
返回 下载 相关 举报
matlab课件第三章.ppt_第1页
第1页 / 共30页
matlab课件第三章.ppt_第2页
第2页 / 共30页
matlab课件第三章.ppt_第3页
第3页 / 共30页
matlab课件第三章.ppt_第4页
第4页 / 共30页
matlab课件第三章.ppt_第5页
第5页 / 共30页
点击查看更多>>
资源描述

《matlab课件第三章.ppt》由会员分享,可在线阅读,更多相关《matlab课件第三章.ppt(30页珍藏版)》请在三一办公上搜索。

1、6.图形加注功能+LaTeX字符 p88,将标题、坐标轴标记、网格线及文字注释加注到图形上,这些函数为:title 给图形加标题 xlable 给x轴加标注 ylable 给y轴加标注 text 在图形指定位置加标注 gtext 将标注加到图形任意位置 grid on(off)打开、关闭坐标网格线 legend 添加图例 axis 控制坐标轴的刻度,例:t=0:0.1:10y1=sin(t);y2=cos(t);plot(t,y1,r,t,y2,b-);x=1.7*pi;1.6*pi;y=-0.3;0.8;s=sin(t);cos(t);text(x,y,s);title(正弦和余弦曲线);l

2、egend(正弦,余弦);xlabel(时间t);ylabel(正弦、余弦);Grid on;axis square,2,4,6,8,10,时间t,axis的用法还有:axis(xmin xmax ymin ymax)用行向量中 给出的值设定坐标轴的最大和最小值。如axis(-2 2 0 5)axis(equal)将两坐标轴设为相等 axis on(off)显示和关闭坐标轴的标 记、标志 axis auto 将坐标轴设置返回自动缺 省值,7.fplot 绘制函数图(自适应采样)p96,fplot的调用格式:fplot(fun,lims)绘制函数fun在x区间 lims=xmin xmax的函数

3、图。fplot(fun,lims,corline)以指定线形绘图。x,y=fplot(fun,lims)只返回绘图点的值,而不绘图。用plot(x,y)来绘图。,fplot(sin(x),tan(x),cos(x),2*pi*-1 1-1 1)fplot(humps,0 1,rp)fplot(sin(x),0 2*pi,*),8.ezplot 符号函数绘图(隐函数)p112,ezplot(f)这里f为包含单个符号变量x的符号表达式(不易求解的),在x轴的默认范围-2*pi 2*pi内绘制f(x)的函数图ezplot(f,xmin,xmax)给定区间ezplot(f,xmin,xmax,figu

4、re(n)指定绘图窗口绘图。,ezplot(sin(x)ezplot(sin(x),cos(y),-4*pi 4*pi,figure(2),ezplot(sin(x)ezplot(sin(x),cos(y),-4*pi 4*pi,figure(2),ezplot(x,y,tmin,tmax,fig)ezplot(sin(3*t)*cos(t),sin(3*t)*sin(t),0,pi);ezplot(t*cos(t),t*sin(t),0,4*pi,figure(2);,(二)fill 基本二维绘图函数 fill的功能:绘制二维多边形并填充颜色例:x=1 2 3 4 5;y=4 1 5 1 4

5、;fill(x,y,r),(三)特殊二维绘图函数,bar 绘制直方图 polar 绘制极坐标图 hist 绘制统计直方图 stairs 绘制阶梯图 stem 绘制火柴杆图 rose 绘制统计扇形图 comet 绘制彗星曲线,errorbar 绘制误差棒图 compass 复数向量图(罗盘图)feather 复数向量投影图(羽毛图)quiver 向量场图 area 区域图 pie 饼图 convhull 凸壳图 scatter 离散点图,例,绘制阶梯曲线x=0:pi/20:2*pi;y=sin(x);stairs(x,y),例:阶梯绘图h2=1 1;1-1;h4=h2 h2;h2-h2;h8=h

6、4 h4;h4-h4;t=1:8;subplot(8,1,1);stairs(t,h8(1,:);axis(off)subplot(8,1,2);stairs(t,h8(2,:);axis(off)subplot(8,1,3);stairs(t,h8(3,:);axis(off)subplot(8,1,4);stairs(t,h8(4,:);axis(off)subplot(8,1,5);stairs(t,h8(5,:);axis(off)subplot(8,1,6);stairs(t,h8(6,:);axis(off)subplot(8,1,7);stairs(t,h8(7,:);axis(

7、off)subplot(8,1,8);stairs(t,h8(8,:);axis(off),h2=1 1;1-1;h4=h2 h2;h2-h2;h8=h4 h4;h4-h4;t=1:8;for i=1:8subplot(8,1,i);stairs(t,h8(i,:)axis(off)end,例:绘制极坐标绘图t=0:2*pi/90:2*pi;y=cos(4*t);polar(t,y),例:绘制火柴杆绘图 t=0:0.2:2*pi;y=cos(t);stem(y),例:绘制直方图 t=0:0.2:2*pi;y=cos(t);bar(y),例:绘制彗星曲线图 t=-pi:pi/500:pi;y=tan(sin(t)-sin(tan(t);comet(t,y),x=magic(6);area(x),x=1 2 3 4 5 6 7;y=0 0 0 1 0 0 0;pie(x,y),pie(x,y,North,South,East,West,middle,fa,white),load seamountscatter(x,y,50,z),a=rand(200,1);b=rand(200,1);c=rand(200,1);scatter(a,b,100,c,p),

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号