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
A matlab function to calculate filter order

Illustration of if - else statement: The one application of an if-else statement is to check for errors in the inputs to a script. For illustration, a former script prompted t

Illustration sorting vectors of structures: This function sorts the structures depend only on the price field. A more common function is shown next, that receives a string whi

Algorithm for the function explaine: The algorithm for the function explaine is as shown:  Print a description of e, the exp function, and how to find the approximate va

Preallocating a Vector: There are necessarily two programming techniques that can be used to simulate the cumsum function. One technique is to begin with an empty vector and c

ischar function: The ischar function return the logical true if an array is a character array, or logical false if not. >> vec = 'EK127'; >> ischar(vec) ans =

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

Splits a string : The strtok function splits a string into pieces; it can be called in many ways. The function receives one string as an input argument. It appears for the fir

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

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)