1, Fplot ()
This command is commonly used to draw an image of a symbolic function, in the following format:
Fplot (fun,lims), where fun is a symbolic function expression, which the LIMS uses to declare the plot interval.
For example:
Draw function: F (x) =sinx+x;
>> lims=[-5,5]>> fplot ('sin (x) +x ', LIMs)
2. Plot ()
The command plot () is primarily a drawing of an image that draws a function in a numeric calculation, in the form of:
Plot (x, y,s), where x is the horizontal coordinate vector of the function, Y is the ordinate vector of the function, and S is used to define the color and linetype of the function.
Common color parameters are: R (Red), B (Blue), K (Black), W (White), G (green), M (dark red), Cyan (c)
Example:
Drawing an image of the y=1/2* (x+1/x) function and its inverse function
>>X=1:0.001:5;>>Y=1/2*(x+1./x);>>Plot (x, Y,'R', Y,x,'b')
3, Ezplot ()
This drawing command is commonly used to draw simple images of symbolic functions. The format is:
Ezplot (f)
Ezplot (F,lims)
Where f is the symbolic function expression, LIMs is the plot interval.
Example:
Draw the image of the function f (x, y) =x^3+y^3-5*x*y+1/5;
>> ezplot ('x^3+y^3-5*x*y+1/5')
Comparison:
(1) Fplot (), Ezplot () are all for symbolic functions, and plot () is a function image in numerical calculation;
(2) Fplot () only need to give the function and interval on the line, and plot () need to calculate the horizontal and coordinate vector, it is based on the point of calculation to draw the image;
(3) Ezplot () Even the drawing interval is not given.
Note: Symbolic calculation and numerical calculation are two different functions of MATLAB. Symbolic computing systems deal with the object is symbolic expression, the output is also a symbolic expression, the numerical calculation of the processing of the object is a numeric variable, the result of the output is a number or an array.
MATLAB drawing Commands