Simplification functions, MATLAB in Engineering

Simplification Functions:

There are numerous functions which work with expressions, and simplify the terms. Not all the expressions can be simplified, but the simplify function does anything it can to simplify expressions, involving gathering like terms. For illustration:

>> x = sym('x');

>> myexpr = cos(x)^2 + sin(x)^2

myexpr =

cos(x)^2 sin(x)^2

>> simplify(myexpr)

ans =

1

The functions expand, collect, and factor work with polynomial expressions. The collect function collects the coefficients, for illustration,

>> x = sym('x');

>> collect(x^2 + 4*x^3 + 3*x^2)

ans =

4*x^2 4*x^3

Posted Date: 10/22/2012 4:35:07 AM | Location : United States







Related Discussions:- Simplification functions, Assignment Help, Ask Question on Simplification functions, Get Answer, Expert's Help, Simplification functions Discussions

Write discussion on Simplification functions
Your posts are moderated
Related Questions
Plotting File data: It is frequently essential to read data from a file and plot it. Generally, this entails knowing the format of the file. For illustration, let us suppose t

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

Displaying expressions: The good-looking function will show such expressions by using exponents; for illustration, >> b = sym('x^2') b = x^2 >> pretty(b)

Solving 2 × 2 systems of equations: However this may be easy in a MATLAB, in normal finding solutions to the systems of equations is not. The systems which are 2 × 2 are, thou

Illustration of Matrix solutions: For illustration, consider the three equations below with 3unknowns x 1 ,x 2 , and x 3 : We can write this in the form Ax = b here A

Gauss Elimination: The Gauss elimination technique consists of:    Generating the augmented matrix [A b]    Applying EROs to augmented matrix to obtain an upper trian

Scaling:   change a row by multiplying it by a non-zero scalar sri →  ri For illustration, for the matrix:

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)

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

Finding products by for loop: an illustration, when 5 is passed to be the value of the input argument n, the function will compute and return 1 + 2 + 3 + 4 + 5, or 15: >> s