当前位置:网站首页>捡起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
- 怎么看基金是不是reits,通过银行购买基金安全吗
- PHP classes and objects
- JS regular détermine si le nom de domaine ou le chemin de port IP est correct
- 时序模型:长短期记忆网络(LSTM)
- APISIX jwt-auth 插件存在错误响应中泄露信息的风险公告(CVE-2022-29266)
- 一刷313-剑指 Offer 06. 从尾到头打印链表(e)
- matplotlib教程05---操作图像
- vim指定行注释和解注释
- Merging of Shanzhai version [i]
猜你喜欢

Use bitnami PostgreSQL docker image to quickly set up stream replication clusters

CAP定理

Spark 算子之交集、并集、差集

Codejock Suite Pro v20. three

mysql乐观锁解决并发冲突

多线程原理和常用方法以及Thread和Runnable的区别

Method 2 of drawing ROC curve in R language: proc package

Distinct use of spark operator

Spark 算子之distinct使用

Read the meaning of serial port and various level signals
随机推荐
删除字符串中出现次数最少的字符
Spark 算子之sortBy使用
Application of Bloom filter in 100 million flow e-commerce system
Codejock Suite Pro v20. three
Upgrade MySQL 5.1 to 5.66
布隆过滤器在亿级流量电商系统的应用
APISIX jwt-auth 插件存在错误响应中泄露信息的风险公告(CVE-2022-29266)
Treatment of idempotency
pywintypes. com_ Error: (- 2147221020, 'invalid syntax', none, none)
One brush 312 - simple repetition set - Sword finger offer 03 Duplicate number in array (E)
字符串最后一个单词的长度
JS regular determines whether the port path of the domain name or IP is correct
Partitionby of spark operator
王启亨谈Web3.0与价值互联网“通证交换”
String sorting
Upgrade MySQL 5.1 to 5.611
Leetcode-396 rotation function
Upgrade MySQL 5.1 to 5.69
shell_ two
The biggest winner is China Telecom. Why do people dislike China Mobile and China Unicom?