当前位置:网站首页>捡起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
边栏推荐
- Neodynamic Barcode Professional for WPF V11. 0
- IronPDF for .NET 2022.4.5455
- Configuration of multi spanning tree MSTP
- 多线程原理和常用方法以及Thread和Runnable的区别
- utils. Deprecated in35 may be cancelled due to upgrade. What should I do
- C, calculation method and source program of bell number
- Codejock Suite Pro v20. three
- MySQL Cluster Mode and application scenario
- C#,贝尔数(Bell Number)的计算方法与源程序
- 【开源工具分享】单片机调试助手(示波/改值/日志) - LinkScope
猜你喜欢
负载均衡器
Master vscode remote GDB debugging
Partitionby of spark operator
Treatment of idempotency
Metalife established a strategic partnership with ESTV and appointed its CEO Eric Yoon as a consultant
Use bitnami PostgreSQL docker image to quickly set up stream replication clusters
WPS brand was upgraded to focus on China. The other two domestic software were banned from going abroad with a low profile
王启亨谈Web3.0与价值互联网“通证交换”
CAP定理
一文读懂串口及各种电平信号含义
随机推荐
[AI weekly] NVIDIA designs chips with AI; The imperfect transformer needs to overcome the theoretical defect of self attention
单体架构系统重新架构
Extract non duplicate integers
Pgpool II 4.3 Chinese Manual - introductory tutorial
R语言中绘制ROC曲线方法二:pROC包
运维流程有多重要,听说一年能省下200万?
One brush 314 sword finger offer 09 Implement queue (E) with two stacks
多生成树MSTP的配置
Leetcode-374 guess the size of the number
String sorting
JS regular détermine si le nom de domaine ou le chemin de port IP est correct
TIA博图——基本操作
CVPR 2022 quality paper sharing
Spark 算子之partitionBy
Method 2 of drawing ROC curve in R language: proc package
Codejock Suite Pro v20.3.0
Single architecture system re architecture
leetcode-396 旋转函数
IronPDF for . NET 2022.4.5455
PHP classes and objects