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
Example of modular program: In a modular program, there would be one main script which calls three separate functions to complete these tasks: A function to prompt an us

Plotting from a Function: The following function creates a Figure Window as shown in figure, which shows various types of plots for similar y vector. The vector is passed as a

Execute a exponential function program: Running the script will take up the menu as shown in the figure: Then, what happens will totally depend on which button(s) the

Vectors of Structures: In numerous applications, involving database applications, information generally would be stored in the vector of structures, instead of in individual s

Defined a variable in work space: The variables defined in the script will become a part of the workspace: >> clear >> who >> mysummfile    15 >> who

Modular programs: In a modular program, the answer is broken down into modules, and each is executed as a function. The script is usually known as the main program. In orde

Expanding a function: The expand function will multiply out terms, and factor will do the opposite: >> expand((x+2)*(x-1)) ans = x^2 x-2 >> factor(ans)

Replacement : Replace a row by adding it to (or subtract from it) a multiple of the other row. For a given row ri, this is written as   ri  - srj →  ri Note that when r

Example of Menu driven modular program: As an illustration of such a menu-driven program, we will write a program to discover the constant e. The constant e, known as the n

Finding a sting - function findstr: The function findstr receives two strings as input arguments. It finds all the occurrences of shorter string contained by the longer, and r