MATLAB have a few operator types to manipulate shown below Note: Variables a and b below represents number
Arithmetic Operations
Arithmetic Operator is used as mathematical operator that manipulates the number according to the formula requirement. The result is shown as numbers.
Arithmetic Operator
Addition
a + b
Subtraction
a - b
Multiplication
a * b
Forward division
a / b
Backward division
a \ b
Exponentiation
a ^ b
Assignment
a = b
Relational Operations
Relational Operator is used to check if numbers are having any significant relationship with one or another. The results is usually is shown TRUE or FALSE.
Relational Operator
Equal To
a == b
Not Equal To
a ~= b
Greater than
a > b
Greater or equal to
a >= b
Lesser than
a < b
Lesser or equal to
a <= b
Logical Operations
Logical Operator is used to check if number fulfills the logical conditions, the result is usually shown TRUE or FALSE.
Logical Operator
Logical AND
a && b
Logical OR
a || b
Logical NOT
a ~ b
Elementary Mathematics Constants and Functions
Besides mathematical formula, there are a few mathematical constant and function that you can use to make your works in Matlab easier.
More information about the functions used can be found here:Mathematical_symbols
pi
Returns value of 3.1416 (Note: Ratio of a circle's circumference to its diameter)
sqrt(a)
Returns square root of a
exp(1)
Returns value of 2.7183 This is exponential function (Note: it is inverse of natural log, try log(exp(1) and see the result)
log(a)
This logarithm operator is to find natural number log of a number
log10(a)
This base10 log operator is common logarithm for base 10
mod(a,b) or rem(a,b)
This modulo operator returns the remainder after a is divided by b.
: (Colon)
Generate a sequence
round(a,b)
This rounding operator round up to the number to the nearest digit "a" by the significant digit "b"
b > 0: round to a digits to the right of the decimal point.
b = 0: round to the nearest integer.
b < 0: round to a digits to the left of the decimal point.
primes(a)
Returns a list of prime numbers less than or equal to number a
You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.