Displaying expressions, MATLAB in Engineering

Displaying expressions:

The good-looking function will show such expressions by using exponents; for illustration,

>> b = sym('x^2')

b =

x^2

>> pretty(b)

                 x

2

 

There are many plot functions in a MATLAB with names starting with "ez" which perform the essential conversions from symbolic expressions to numbers and plot them. For illustration, the function ezplot will draw a 2-D plot in the x-range from -2π to 2π, with the expression as the title. The expression

>> ezplot('x^3 + 3*x^2 - 2')

generates the figure as shown in figure.

159_Displaying expressions.png

The domain for the ezplot function can also be identified; for illustration, to change the x-axis to be from 0 to π, it is identified as a vector. The result is as shown in figure.

>> ezplot('cos(x)',[0 pi])

Posted Date: 10/22/2012 4:37:36 AM | Location : United States







Related Discussions:- Displaying expressions, Assignment Help, Ask Question on Displaying expressions, Get Answer, Expert's Help, Displaying expressions Discussions

Write discussion on Displaying expressions
Your posts are moderated
Related Questions
Gauss, Gauss-Jordan elimination: For 2 × 2 systems of equations, there are well-defined, easy solution techniques. Though, for the larger systems of equations, finding solutio

Technique to create Nested structures: This technique is the most proficient. Though, the other technique is to build the nested structure one field at a time. As this is a ne

Help command: The help command is used with the script rectarea, the function readlenwid, and the major function printrectarea. To see the first comment in the subfunction, as

Initializing the data structure - Function: Function is shown as:   >> printcylvols(cyls) Cylinder x has a volume of 169.6 Cylinder a has a volume of 100.5

Function strncmp: The function strncmp compares only the first n characters in the strings and ignores the rest. The initial two arguments are strings to compare, and third ar

Referring to and Showing Cell Array Elements and Attributes: Just as with the other vectors, we can refer to individual elements of the cell arrays. The only difference is tha

Execution steps: Whenever the program is executed, the steps below will take place: The script calcandprintarea starts executing. The calcandprintarea calls the readr

Example to change the line width from the default: For illustration, to change the line width from the default of 0.5 to 1.5: >> set(hl,'LineWidth',1.5) As long as the

Illustration of initializing the data structure: illustration of initializing the data structure by preallocating is here as shown: >> cyls(3) = struct('code', 'c', 'dimen

ischar function: The ischar function return the logical true if an array is a character array, or logical false if not. >> vec = 'EK127'; >> ischar(vec) ans =