当前位置:网站首页>捡起MATLAB的第(5)天
捡起MATLAB的第(5)天
2022-04-23 15:54:00 【Sola_Ex】
Matlab
二维曲线绘制
plot()函数
plot(x,y) %x为横坐标,y为纵坐标
ploy(y) %序号作为横坐标,y作为纵坐标
plot(x,y,s) %s表示输出样式
常用的图形修饰命令
图形窗口分割
subplot(m,n,p) %把当前窗口分成m*n个绘图区,p代表序号
如:
subplot(2,2,1)
subplot(2,2,2)
subplot(2,2,3)
subplot(2,2,4)
线性直角坐标图
绘制命令如下:
bar(x,y,s) %条形图
stairs(x,y,s) %阶梯图
stem(x,y,s) %杆图
fill(x,y,s) %填充图
实例代码使用:
x=0:0.4:8;
y = 2*exp(-0.5*x);
subplot(2,2,1);
bar(x,y,'r');
title('bar(x,y,"red")');
axis([-2,8.1,-1,2.1]);
subplot(2,2,2);
bar(x,y,'g');
title('bar(x,y,"green")');
axis([-2,8.1,-1,2.1]);
...
对数坐标图
应用场景:
- 变量在研究范围发生了数量级的变化时
- 当自变量少许变化会引起因变量极大变化时
- 需要将曲线部分划分为展开的形式时
- 需要变换某种非线性关系为线性关系时
执行命令有:
semilogx(x,y,s) %半对数坐标,x轴为对数刻度
semilogy(x,y,s) %半对数坐标,y轴为对数刻度
loglog(x,y,s) %半对数坐标,x,y轴均为对数刻度
实例使用
x=1:1e4;
y=20*log10(x.^2-x.^3);
plot(x,y)
figure; %新建多一张图
semilogx(x,y,'r');
效果如图:
极坐标图
polar(theta,rho,s) %theta = 极坐标极角,rho=极径
实例代码:
t=0:.01:2*pi;
r1=cos(9*t);
polar(t,r1,'-m')
title('给CK的玫瑰线')
我觉得还是挺好看的哈哈哈哈!!!
版权声明
本文为[Sola_Ex]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_42312125/article/details/107479466
边栏推荐
- 一文读懂串口及各种电平信号含义
- New developments: new trends in cooperation between smartmesh and meshbox
- C, calculation method and source program of bell number
- IronPDF for . NET 2022.4.5455
- 大型互联网为什么禁止ip直连
- C language --- advanced pointer
- Deletes the least frequently occurring character in the string
- Function summary of drawing object arrangement in R language
- matplotlib教程05---操作图像
- Upgrade MySQL 5.1 to 5.67
猜你喜欢
幂等性的处理
MySQL Cluster Mode and application scenario
Neodynamic Barcode Professional for WPF V11. 0
The principle and common methods of multithreading and the difference between thread and runnable
Large factory technology implementation | industry solution series tutorials
Master vscode remote GDB debugging
TIA博图——基本操作
时序模型:长短期记忆网络(LSTM)
王启亨谈Web3.0与价值互联网“通证交换”
5分钟,把你的Excel变成在线数据库,神奇的魔方网表excel数据库
随机推荐
Multi level cache usage
Groupby use of spark operator
Go language, condition, loop, function
Unity shader learning
保姆级Anaconda安装教程
VIM specifies the line comment and reconciliation comment
pywintypes. com_ Error: (- 2147221020, 'invalid syntax', none, none)
Go语言切片,范围,集合
Interview questions of a blue team of Beijing Information Protection Network
s16.基于镜像仓库一键安装containerd脚本
R语言中实现作图对象排列的函数总结
【第5节 if和for】
JS regular détermine si le nom de domaine ou le chemin de port IP est correct
Ice -- source code analysis
Coalesce and repartition of spark operators
一文读懂串口及各种电平信号含义
C, calculation method and source program of bell number
【现代电子装联期末复习要点】
【开源工具分享】单片机调试助手(示波/改值/日志) - LinkScope
怎么看基金是不是reits,通过银行购买基金安全吗