当前位置:网站首页>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
边栏推荐
猜你喜欢

Modèle de Cluster MySQL et scénario d'application

How can poor areas without networks have money to build networks?

JVM - Chapter 2 - class loader subsystem

Application of Bloom filter in 100 million flow e-commerce system

C语言自编字符串处理函数——字符串分割、字符串填充等

一文读懂串口及各种电平信号含义

Unity shader learning

Filter usage of spark operator

下载并安装MongoDB

Metalife established a strategic partnership with ESTV and appointed its CEO Eric Yoon as a consultant
随机推荐
Open source project recommendation: 3D point cloud processing software paraview, based on QT and VTK
Application case of GPS Beidou high precision satellite time synchronization system
The length of the last word of the string
Upgrade MySQL 5.1 to 5.610
Multi level cache usage
运维流程有多重要,听说一年能省下200万?
Start Oracle service on Linux
Temporal model: long-term and short-term memory network (LSTM)
Fastjon2他来了,性能显著提升,还能再战十年
TIA博图——基本操作
Algorithem_ ReverseLinkedList
vim指定行注释和解注释
VIM specifies the line comment and reconciliation comment
Modèle de Cluster MySQL et scénario d'application
JS regular détermine si le nom de domaine ou le chemin de port IP est correct
One brush 314 sword finger offer 09 Implement queue (E) with two stacks
How do you think the fund is REITs? Is it safe to buy the fund through the bank
Large factory technology implementation | industry solution series tutorials
Cap theorem
Load Balancer