Basic mathematical operations, MATLAB in Engineering

Basic mathematical operations:

All the basic mathematical operations can be executed on symbolic expressions and variables (example, add, raise to a power, multiply, subtract, divide, etc.).

Here are some illustrations:

>> c/b

ans =


>> b^3

ans =


>> c*b

ans =


>> b + sym('4*x^2')

ans =


It can be view from the last illustration that MATLAB will collect like words in such expressions, adding the x2 and 4x2 to answer in 5x2.

The below generates a symbolic expression by passing a string, but the words are not automatically collected:

>> sym('z^3 + 2*z^3')

ans =

z^3   2*z^3

Posted Date: 10/22/2012 4:31:32 AM | Location : United States

Related Discussions:- Basic mathematical operations, Assignment Help, Ask Question on Basic mathematical operations, Get Answer, Expert's Help, Basic mathematical operations Discussions

Write discussion on Basic mathematical operations
Your posts are moderated
Related Questions
Storing Strings in Cell Arrays: The one good application of a cell array is to store strings of various lengths. As cell arrays can store various types of values in the elemen

Illustration of Set operations: For illustration, given the vectors as shown below: >> v1 = 2:6 v1 = 2  3  4  5  6 >> v2 = 1:2:7 v2 = 1  3  5  7

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

Function cirarea - Anonymous functions: The function handle name is cirarea. The one argument is passed to the input argument radius. The body of the function is an expression

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

Text graphic function - Graphics objects: The text graphic function permits text to be printed in a Figure Window, involving special characters which are printed by using \spe

For Loops which do not use an iterator Variable in the action: In all the illustrations that we seen so far, the value of the loop variable has been used in same way in the ac

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

Algorithm for expfn function: The algorithm for expfn function is as shown:  receives the value of x as the input argument.  Prints the value of exp(x).  assigns a