Another command in Matlab® to draw 2D curves from equations is the ‘ezplot()’ command. Besides conventional methods to draw 2D curves in Matlab®, ‘ezplot()’ is also a very useful alternative.
YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!
Here, we explain how to use the ‘ezplot()’ command to draw 2D curves in Matlab® with the very basic example below. The code example is executed in the Matlab® command window. So you can try it in your Matlab software.
>> syms x y = x^3+3*x+6; ezplot(y, -10, 10) >>
Take a look at the code example above to understand syntax also. Firstly, we created a symbolic variable ‘x’ with the syms command. We can use this variable to create our functions or equations.
Then we typed our equation according to Matlab® coding syntax and assigned it to ‘y’.
In the ‘ezplot()’ command, we typed the ‘y’ and we defined the boundaries of your 2D curve in X and Y axes. You can see the result like below;
You can edit this graph to a more illustrative shape by using Matlab® tools for it.
The use of the ‘ezplot()’ command in MatLab® is very simple like that.
Do not forget to leave your comments and questions below about the use of the ‘ezplot()’ command in Matlab® below.
If you want further coding examples about the ‘ezplot()’ command in Matlab®, inform us in the comments.
This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®
Your precious feedbacks are very important to us.