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
Anonymous Functions: The anonymous function is a very easy, one-line function. The benefit of an anonymous function is that it does not have to be stored in an M-file. This ca

readlenwid function: function call: [length, width] = readlenwid; function header: function [l,w] = readlenwid In the function call, not any argument is passed; henc

Illustration of Subfunctions: This is an illustration of running this program: >> rectarea Please enter the length: 6 Please enter the width: 3 For a rectan

Reading from a File in a While Loop: Though in most languages the combination of a loop and an if statement would be essential to determine whether or not the elements in a ve

Binary Search: The binary search supposes that the vector has been sorted first. The algorithm is just similar to the way it works whenever looking for a name in a phone direc

Forward substitution: The Forward substitution (done methodically by first getting a 0 in the a 21 place, and then a 31 , and lastly a 32 ): For the Gauss technique,

Illustration of Gauss elimination: For illustration, for a 2 × 2 system, an augmented matrix be: Then, the EROs is applied to obtain the augmented matrix into an upper

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

Example of image processing: The other illustration generates a 5 × 5 matrix of arbitrary integers in the range from 1 to the number of colors; the resultant image is as shown

Comparing strings: There are few functions which compare strings and return logical true when they are equivalent or logical false when not. The function strcmp compares the s