当前位置:网站首页>Day (5) of picking up matlab
Day (5) of picking up matlab
2022-04-23 15:59:00 【Sola_ Ex】
Pick up MATLAB The fifth day of
Matlab
Two dimensional curve drawing
plot() function
plot(x,y) %x Abscissa ,y Vertical coordinates
ploy(y) % Serial number as abscissa ,y As ordinate
plot(x,y,s) %s Output style representation
Common graphic decoration commands

Graphics window segmentation
subplot(m,n,p) % Divide the current window into m*n A drawing area ,p For serial number
Such as :
subplot(2,2,1)
subplot(2,2,2)
subplot(2,2,3)
subplot(2,2,4)
Linear Cartesian graph
The drawing commands are as follows :
bar(x,y,s) % Bar chart
stairs(x,y,s) % Stairs
stem(x,y,s) % Bar graph
fill(x,y,s) % Fill in the picture
The example code uses :
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]);
...
Logarithmic plot
Application scenarios :
- When the variable changes by an order of magnitude in the scope of the study
- When the dependent variable changes a little
- When the curve part needs to be divided into expanded form
- When it is necessary to transform a nonlinear relationship into a linear relationship
There are :
semilogx(x,y,s) % Semilogarithmic coordinates ,x The axis is a logarithmic scale
semilogy(x,y,s) % Semilogarithmic coordinates ,y The axis is a logarithmic scale
loglog(x,y,s) % Semilogarithmic coordinates ,x,y The axis is logarithmic scale
Case use
x=1:1e4;
y=20*log10(x.^2-x.^3);
plot(x,y)
figure; % Create a new picture
semilogx(x,y,'r');
The effect is as shown in the picture :

Polar diagram
polar(theta,rho,s) %theta = Polar coordinates and polar angles ,rho= Polar diameter
The sample code :
t=0:.01:2*pi;
r1=cos(9*t);
polar(t,r1,'-m')
title(' to CK Rose thread ')

I think it's still very good-looking. Ha ha ha !!!
版权声明
本文为[Sola_ Ex]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231554164100.html
边栏推荐
- 捡起MATLAB的第(10)天
- C#,贝尔数(Bell Number)的计算方法与源程序
- volatile的含义以及用法
- js正則判斷域名或者IP的端口路徑是否正確
- 捡起MATLAB的第(6)天
- New developments: new trends in cooperation between smartmesh and meshbox
- Leetcode-396 rotation function
- Vim使用Vundle安装代码补全插件(YouCompleteMe)
- Treatment of idempotency
- JS regular determines whether the port path of the domain name or IP is correct
猜你喜欢

Tencent offer has been taken. Don't miss the 99 algorithm high-frequency interview questions. 80% of them are lost in the algorithm

C, calculation method and source program of bell number

Ice -- source code analysis

一文掌握vscode远程gdb调试

Sortby use of spark operator

Day (8) of picking up matlab

Coalesce and repartition of spark operators

安装Redis并部署Redis高可用集群

撿起MATLAB的第(9)天

5 minutes, turn your excel into an online database, the magic cube net table Excel database
随机推荐
R语言中绘制ROC曲线方法二:pROC包
JS regular determines whether the port path of the domain name or IP is correct
volatile的含义以及用法
糖尿病眼底病变综述概要记录
Named in pytoch_ parameters、named_ children、named_ Modules function
js正則判斷域名或者IP的端口路徑是否正確
Day (7) of picking up matlab
gps北斗高精度卫星时间同步系统应用案例
Leetcode-374 guess the size of the number
pywintypes. com_ Error: (- 2147221020, 'invalid syntax', none, none)
GRBL学习(二)
Win11/10家庭版禁用Edge的inprivate浏览功能
MySQL Cluster Mode and application scenario
捡起MATLAB的第(2)天
【开源工具分享】单片机调试助手(示波/改值/日志) - LinkScope
Treatment of idempotency
One brush 313 sword finger offer 06 Print linked list from end to end (E)
IronPDF for . NET 2022.4.5455
[open source tool sharing] MCU debugging assistant (oscillograph / modification / log) - linkscope
Large factory technology implementation | industry solution series tutorials