当前位置:网站首页>Drawing curve with MATLAB
Drawing curve with MATLAB
2022-06-10 10:23:00 【Prosperity is like love】
draw a curve
plot(x,y):x and y For vectors of the same length , They are used to store x Coordinates and y coordinate
plot(x1,y1, Options 1,x2,y2, Options 2...): Multiple groups of polylines
plot3(x1,y1,z1, Options 1,xn,yn,zn, Options n) : The space curve
fplot('fun',[a,b]): draw fun The function is in the interval [a,b] Graphics on ,fun It can be a function or an expression
% The above options can be
% Linetype - Solid line : Dotted line -. Point line -- Underline
% Dot the mark . spot o circle x fork + plus * asterisk s square d The diamond
% ^ Upward triangle v Down > To the right < Left triangle p Pentagonal h hexagon
% Color b Blue ( Default ) m Brown c Cyan r Red g green y yellow w white k black
% example
x = 0:pi/100:2pi;
y = 2exp(-0.5x).sin(2pix);
plot(x,y,‘ro’); % among ’r*' Is the above option
2exp(-0.5x)sin(2pix),[0,2pi],‘gd’);
% Three dimensional drawing
t =0:pi/50:2pi;
x = 8cos(t); y = 4*sqrt(2)sin(t);
z = -4sqrt(2)*sin(t);
plot3(x,y,z,‘sk’);
% Surface graphics
% Generation of plane grid coordinates
x =a:dx:b;
y = c:dy:d;
[X,Y] = meshgrid(x,y);
% Functions for drawing 3D surfaces
% mesh(x,y,z): Grid ;
% surf(x,y,z) : Surface graph ( Fill the mesh );
% contour(x,y,z): Contour map ( plan );
% contour3(x,y,z): Three dimensional contour map ( Spatial map );
% example
figure
xa=-2:0.2:2; ya = xa;
[x,y]=meshgrid(xa,ya);
z = x.*exp(-x.2-y.2);
mesh(x,y,z) ; pause(2); % Grid
surf(x,y,z) ; pause(2); % Fill the mesh
contour(x,y,z) ; pause % Plane contour line
contour3(x,y,z) ; pause % Solid contour lines
contour(x,y,z,[-0.1 0.1]);
surf(x,y,z);
% Segmentation of graphics window subplot(m,n,p)
hold off % Release the graphics of the current graphics window
x = linspace(0,2pi,60);
y = sin(x);
z = cos(x);
subplot(2,2,1); %2 That's ok x2 In column 1 District No
plot(x,y); title(‘sin(x)’); axis([0,2pi,-1,1]);
subplot(2,1,2); %2 That's ok 1 Zone 2 in the column
plot(x,z,''); title(‘cos(x)’); axis([0,2*pi,-1,1]);
x = linspace(-2,2,60);
y = x.^3;
subplot(2,2,2); %2 That's ok x2 In column 2 District No
plot(x,y); title(‘x^3’); axis([-2,2,-4,4]);
% Graphic labels
% title( Graphic name ) xlabel(x Axis description ) ylabel(y Axis description )
% Loop statement
hold on /off % Retain / Release existing drawings
figure / close % The opening of new / Close the graphics window
grid on /off % draw / No gridlines , No parameters grif The command switches between the two states
axis on /off % Show / Cancel axis
axis([xmin xmax ymin ymax zmin zmax]) % Limit the range of the coordinate axis
边栏推荐
- phpstrom 将项目上传码云
- [edge detection] eight direction Sobel image edge detection based on MATLAB [including Matlab source code 1865]
- [golang] input and condition control through BMI index learning console
- 张小白教你使用OGG实现Oracle 19C到MySQL 5.7的数据同步(2)
- Print: Entry, ':CFBundleIdentifier', Does Not Exist
- Force buckle 1037 Effective boomerang
- xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve
- Print: Entry, ':CFBundleIdentifier', Does Not Exist
- 成都测试设备定制_单片机C语言之数据类型初步介绍
- "Pit" of mongoreplay
猜你喜欢

Fastadmin uses phpexcel to export tabular data to excel

PhpStorm配置数据库连接

山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(十七)

仿淘宝商品详情,下拉切换到图片详情,上拉切换到图文简介

Microsoft exposes another "scandal": watching VR porn in the office, "the father of hololens" is about to leave!

干货!基于掩码标签平滑的机器翻译模型训练方法

Xcode8.3.2 automatic packaging script

Requirements and business model analysis - Requirements 16 - requirements validation

mdb转换为db文件
![[image feature extraction] image feature extraction based on MATLAB pulse coupled neural network (PCNN) [including Matlab source code 1868]](/img/ca/59f8390c67ceb682e43db7ff8acfd6.png)
[image feature extraction] image feature extraction based on MATLAB pulse coupled neural network (PCNN) [including Matlab source code 1868]
随机推荐
Chengdu test equipment customization_ A preliminary introduction to the data types of C language of single chip microcomputer
ES6 new feature class
SQL server always on monitoring script and some misunderstandings
Theory and application of image processing
All things grow and each is noble
“大写意花鸟画宗师李苦禅先生”重磅数字藏品全网首发
万物生长,各自高贵
2022年金属非金属矿山提升机操作考试题库及答案
[FAQ] summary of common problems and solutions during the use of rest API interface of sports health service
Some problems in using message queue service in thinkphp6
ApiPost的环境变量的定义和使用「ApiPost环境变量」
“会说话的汤姆猫家族-时代逐光者”3D数字藏品中奖名单公布
Concurrent asyncio asynchronous programming
5g Unicom network management design idea
“胡说八道” DATABASE 主键设计
Uncaught TypeError: Cannot read properties of undefined (reading ‘colspan‘)
To serve the "nervous system" with a broad and subtle vision
Force buckle 1037 Effective boomerang
【GoLang】通过BMI指数学习控制台输入与条件控制
Do you know all the wonderful functions of the vlookup function?