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
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

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

Variable Scope: The scope of any of variable is the workspace in which it is valid. The workspace generated in the Command Window is known as the base workspace. As we know

Execute a exponential function program: Running the script will take up the menu as shown in the figure: Then, what happens will totally depend on which button(s) the

Write a program to examine exponential function: We will write a program to examine the value of e and the exponential function. It will be a menu-driven. The menu options wil

calcrectarea subfunction: function call: area = calcrectarea(len,wid); function header: function area = calcrectarea(len, wid)   In the function call, the two arg

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

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

Finding sums and products: A very general application of a for loop is to compute sums and products. For illustration, rather than of just printing the integers 1 through 5, w

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