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 =

x^2

>> b^3

ans =

x^6

>> c*b

ans =

x^6

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

ans =

5*x^2

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
Illustration of Variable scope: Running this function does not add any of variables to the workspace, as elaborated: >> clear >> who >> disp(mysum([5 9 1]))

Print from the structure: To print from the structure, a disp function will show either the whole structure or a field. >> disp(package) item_no: 123 cost: 19.99

Illustration of Image processing: This displays that there are 64 rows, or in another word, 64 colors, in this specific colormap. It also displays that the first five colors a

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

Illustration of symbolic variable: When, on the other hand, z is a symbolic variable to start with, quotes are not required around the expression, and the words are automatica

IS Functions in Matlab: There are many functions which are built into MATLAB which test whether or not something is true; these function names start with the word is. As these

Indexing into Vectors of structures: Frequently, when the data structure is a vector of structures, it is essential to iterate through the vector in order by various fields. F

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

Logical scalar values: The MATLAB also has or and and operators which work element wise for the matrices: These operators will compare any of the two vectors or matric

Use of While loop: Here is an illustration of calling the function, passing 5000 for the value of the input argument high. >> factgthigh(5000) ans = 5040 The itera