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

利用plot_surface命令绘制复杂曲面入门详解

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

Mysql之MVCC

ECP2459耐压60V降压BUCK电路用于WIFI模块供电方案原理图

win10任务栏不合并图标如何设置

Use tencent cloud builds a personal blog

win10 system update error code 0x80244022 how to do

FP5139电池与适配器供电DC-DC隔离升降压电路反激电路电荷泵电路原理图

How to solve Win11 without local users and groups

CI24R1小模块2.4G收发模块无线通信低成本兼容si24r1/XN297超低功耗
随机推荐
Do Windows 10 computers need antivirus software installed?
GMP scheduling model of golang
6.统一记录日志
刷卡芯片CI520可直接PIN对PIN替换CV520支持SPI通讯接口
LeetCode2 电话号码的字母组合
cmake configure libtorch error Failed to compute shorthash for libnvrtc.so
Win10安装了固态硬盘还是有明显卡顿怎么办?
Win11没有本地用户和组怎么解决
What should I do if I install a solid-state drive in Win10 and still have obvious lags?
Mysql connection error solution
FP6195耐压60V电流降压3.3V5V模块供电方案
Win10系统设置application identity自动提示拒绝访问怎么办
开心一下,9/28名场面合集
How to reinstall Win7 system with U disk?How to reinstall win7 using u disk?
Win11 computer off for a period of time without operating network how to solve
使用 腾讯云搭建一个个人博客
win10 system update error code 0x80244022 how to do
MATLAB绘制平面填充图入门详解
In-depth understanding of Golang's Map
FP5139电池与适配器供电DC-DC隔离升降压电路反激电路电荷泵电路原理图