1 / 34
文档名称:

matlab数据可视化.ppt

格式:ppt   大小:599KB   页数:34页
下载后只包含 1 个 PPT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

matlab数据可视化.ppt

上传人:892629196 2017/12/3 文件大小:599 KB

下载得到文件列表

matlab数据可视化.ppt

文档介绍

文档介绍:教师高长生
信箱:******@hit.
办公地点:新技术楼418
哈尔滨工业大学
《计算机辅助设计》
《飞行器飞行力学设计的Matlab仿真》
2012年春季学期
数据可视化
数据可视化
高级绘图命令集归纳
二维绘图 graph2d
三维绘图 graph3d
句柄绘图命令集归纳
句柄图形 graphics
图形用户界面工具uitools/guide
字符串strfun命令集

二维绘图 graph2d
Elementary X-Y graphs.
plot - Linear plot.
polar - Polar coordinate plot.
Axis control.
axis - Control axis scaling and appearance.
zoom - Zoom in and out on a 2-D plot.
grid - Grid lines.
box - Axis box.
hold - Hold current graph.
axes - Create axes in arbitrary positions.
subplot - Create axes in tiled positions.
Graph annotation.
title - Graph title.
xlabel - X-axis label.
ylabel - Y-axis label.
texlabel - Produces the TeX format from a character string.
text - Text annotation.
gtext - Place text with mouse.
Hardcopy and printing.
print - Print graph or Simulink system; or save graph to M-file.
printopt - Printer defaults.
%建立M文件,调试下面程序
%plot绘图命令的使用
clc %清屏命令
clear %清除工作空间中所有变量
%定义时间变量
t=[0,pi/20;9*pi];
y1=sin(t); y2=cos(t);
%绘制y1,y2图形
plot(t,y1,t,y2);
确定 x 和/或 y 数据,确定颜色,线型和符号(如果未指定属性,采用默认值)
语法:绘制单条曲线:
绘制多条曲线:
plot(x1, y1, 'color_linestyle_marker')
plot(x1, y1, 'clm1', x2, y2, 'clm2', ...)
x1,y1是向量, 点集的横坐标和纵坐标
y 黄色. 点- 连线
m 洋红 o 圈: 短虚线
c 蓝绿色 x x-符号-. 长短线 r 红色+ 加号-- 长虚线
二维绘图 graph2d
生成类
例在[0,2*pi]用红线画sin(x),用绿圈画cos(x).
%创建向量X
x=linspace(0,2*pi,30);
y=sin(x);
z=cos(x);
%用一个plot命令绘图
plot(x,y,'r',x,z,'o')

设置动画
生成类
二维绘图 graph2d
%操作: 1)设置断点,逐行操作;2)去掉分号,显示结果
clc;clear
%定义时间范围
t=[0:pi/20:9*pi];
plot(t,sin(t),'r:*')
%允许在同一坐标系下绘制不同的图形
hold on
plot(t,cos(t))
plot(t,-cos(t),'k')
%在所画出的图形坐标中添加栅格
grid on
%覆盖旧图
hold off
plot(t,-sin(t))
grid on:在所画出的图形坐标中加入栅格
grid off:除去图形坐标中的栅格
生成类
二维绘图 graph2d
%图形分割命令的使用
clear; clc
t=[0:pi/20:5*pi];
figure(1);
subplot(321);
plot(t,sin(t))
axis([0 16 - ])
xlabel('t(deg)'); ylabel('magnitude')
grid on
管理类
matlab\scribe
legend - Graph legend.
matlab\graphics
Figure window creation