Math Functions in MATLAB

Math Functions in MATLAB

Commonly Used Math Functions

Function Description
sqrt(x) Square root
nthroot(x,n) Real nth root of real number x
exp(x) Expnential ( e^x)
log(x) Natural Logarithm with base e
log10(x) Logarithm with base 10
factorial(x) Factorial Function

Rounding Functions

Function Description
round(x) Round to nearest integer
fix(x) Round towards zero
ceil(x) Rounds towards upper limit or infinity
floor(x) Round towards lower limit or negative infinity
rem(x,y) Returns reminder, after dividing x by y          i.e. rem(12,5)                                                           ans = 2
sign(x) Return 1 if x is positive number, -1 if x is negative number and 0 if number is equal to 0

Trigonometric Functions

Function Description
sin(x) Sine of angle x ( when x in radians)
sind(x) Sine of angle x ( when x in degrees)
cos(x) Cosine of angle x ( when x in radians)
cosd(x) Cosine of angle x ( when x in degrees)
tan(x) Tangent of angle x ( when x in radians)
tand(x) Tangent of angle x ( when x in degrees)
cot(x) Cotangent of angle x ( when x in radians)
cotd(x) Cotangent of angle x ( when x in degrees)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s