当前位置:网站首页>Introduction to MATLAB drawing functions ezplot explanation
Introduction to MATLAB drawing functions ezplot explanation
2022-08-02 15:32:00 【Yang Lao head soft work】
I. Introduction
The ezplot command can be used to draw the graph of the explicit function, the graph of the implicit function, or the graph of the function determined by the parameter equation, and the system will automatically add the title of the graph, xaxis labels.While fplot is mainly used to draw graphs of explicit functions and functions determined by parametric equations, fimplicit is mainly used to draw graphs of implicit functions.So from a functional point of view, ezplot covers the fplot and fimplicit functions.However, it is not as convenient as fplot and fimplicit to use ezplot to set the color and other attributes of primitives, and you need to use set to set them.If multiple curves are drawn in a graphics window, the system automatically assigns the last function to be the title of the graph, resulting in ambiguity. You need to manually use the title command to add the title.
Second, the basic syntax of ezplot
1) Draw the graphics of the explicit function (I):
ezplot( function, interval )Its function is to draw the graph of the explicit function function on the interval interval. When the interval is default, the interval is -2π < x < 2π .The format of interval is [ min, max ].
2) Drawing the graph of the explicit function (II):
ezplot( @(varible)function, interval )The parameter variable variable is explicitly specified.Its function is to draw the graph of the explicit function function with varible as the independent variable on the interval interval. When the interval is default, the interval is -2π < x < 2π .The format of interval is [ min, max ].
3) Draw the graph of the implicit function (I):
ezplot( function, xyinterval )Its function is to draw the graph of the implicit function determined by the equation function=0 on the interval xyinterval. When xyinterval is default, the interval is -2π < x < 2π , -2π < y < 2π .The format of xyinterval is
[ xmin, xmax, ymin, ymax ].
4) Draw the graph of the implicit function (II):
ezplot( @(varibles)function, xyinterval )Its function is to draw the graph of the implicit function with varibles as 2 variables and determined by the equation function=0 on the interval xyinterval. When xyinterval is default, the interval is -2π < x < 2π , -2π < y< 2π .The format of xyinterval is [ xmin, xmax, ymin, ymax ].
5) Plot the graph of the parametric equation to determine the function (I):
ezplot( xfun, yfun, tinterval )Its function is to draw the graph of the function determined by the equation xfun=0, yfun=0 on the interval tinterval to which the parameter belongs. When tinterval is default, the interval is 0 < t < 2π.
6) Plot the graph of the parametric equation to determine the function (II):
ezplot( @(variable)xfun, @(variable)yfun, tinterval )The parameter variable variable is explicitly specified.Its function is to draw the graph of the function determined by the equation xfun=0, yfun=0 on the interval tinterval to which the parameter belongs. When tinterval is default, the interval is 0 < t < 2π.
3. Specific examples
Example 1. Draw the curve of the function y=sin(x).
% sample codeh = ezplot( 'sin(x)', [ 0, 2 * pi ] );set( h, 'LineStyle', '-.', 'color', 'r', 'LineWidth', 2 );% set primitive properties%Running result
Example 2. Drawing functionThe curve of y=sin(1/x).
% sample codeezplot( @(x)sin(1./x) );%Running Results
Example 3. Drawing equationThe curve represented by x^2 + y^2 = 1.
% sample codeezplot( @(x,y)x.^2 + y.^2 - 1, [ -1, 1, -1, 1 ]);axis equalaxis( [ -1.5, 1.5, -1.5, 1.5 ] )%Running result
Example 4. Draw byThe curve represented by the parametric equation x=ρcos(t),y = ρsin(t).
% sample codeezplot( @(t)cos(t), @(t)sin(t), [ 0, 2*pi ]);axis equalaxis( [ -1.5, 1.5, -1.5, 1.5 ] )% Run result
Example 5. In aThe graphics window plots the functions y=sin(x) and y=cos(x).
% sample codeezplot( 'sin(x)', [ 0, 2 * pi ] );hold onezplot( 'cos(x)', [ 0, 2 * pi ] );% running results (the title of the figure only shows cos(x) at this time)
If the code is modified to:
ezplot( 'sin(x)', [ 0, 2 * pi ] );hold onezplot( 'cos(x)', [ 0, 2 * pi ] );title( 'sin(x), cos(x)' );There is an output:
边栏推荐
- STM32LL库使用——SPI通信
- FP7126降压恒流65536级高辉无频闪调光共阳极舞台灯RGB驱动方案
- How to add a one-key shutdown option to the right-click menu in Windows 11
- MATLAB制作简易小动画入门详解
- Spark及相关生态组件安装配置——快速回忆
- CI24R1小模块2.4G收发模块无线通信低成本兼容si24r1/XN297超低功耗
- DP4056电源保护芯片锂电池pin对pinTP4056
- MATLAB绘图函数fplot详解
- DP4301无线收发SUB-1G芯片兼容CC1101智能家居
- Win11电脑一段时间不操作就断网怎么解决
猜你喜欢

二叉树遍历之后序遍历(非递归、递归)入门详解

CI24R1小模块2.4G收发模块无线通信低成本兼容si24r1/XN297超低功耗

What is Win10 God Mode for?How to enable God Mode in Windows 10?

Win10无法连接打印机怎么办?不能使用打印机的解决方法

Mapreduce环境详细搭建和案例实现

MATLAB制作简易小动画入门详解

Mysql的锁

推开机电的大门《电路》(三):说说不一样的电阻与电导

How to update Win11 sound card driver?Win11 sound card driver update method

The SSE instructions into ARM NEON
随机推荐
Actual combat Meituan Nuxt +Vue family bucket, server-side rendering, mailbox verification, passport authentication service, map API reference, mongodb, redis and other technical points
背包问题-动态规划-理论篇
Win10安装了固态硬盘还是有明显卡顿怎么办?
pygame图像连续旋转
KiCad Common Shortcuts
2021-10-14
Mysql连接错误解决
Codeforces Round #605 (Div. 3)
FP7195大功率零压差全程无频闪调光DC-DC恒流芯片(兼容调光器:PWM调光,无极调光,0/1-10V调光)
为vscode配置clangd
二叉树遍历之后序遍历(非递归、递归)入门详解
Summarize computer network super comprehensive test questions
IPV4和IPV6是什么?
7.Redis
TypeScript 快速进阶
推开机电的大门《电路》(三):说说不一样的电阻与电导
5. Use RecyclerView to elegantly achieve waterfall effect
使用libcurl将Opencv Mat的图像上传到文件服务器,基于post请求和ftp协议两种方法
FP6296锂电池升压 5V9V12V内置 MOS 大功率方案原理图
What should I do if I install a solid-state drive in Win10 and still have obvious lags?