MATLAB drawing Commands

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.