You are on page 1of 4

Computer

Programming

Bachelor in Aerospace Engineering


2012-2013

Important Mathematical Functions and Constants


You must study by heart only the functions marked with an asterisk or placed under a
heading marked with an asterisk.
As for the other functions, you must:

Be able to fully understand any code in which such functions are used.
Be able to use such functions if you are provided with their signature (Y = sin(X) is
the signature of the sin function).

Short-Naming Conventions
In this document, function inputs and outputs are short-named following some simple rules:

Uppercase letters (even if suffixed with a number) represent matrices (X, Y, A1).
Lowercase m's and n's (even if suffixed with a number) represent scalars (m, n, n1).
Lowercase s's (even if suffixed with a number) represent strings (s, s1).
Lowercase letters different from m and n represent vectors (d, f, p).
When the input/output name ends with "expr", it means that symbolic expressions are
involved. For instance, expr and exprOut represent a regular symbolic expression,
dExpr represents a vector containing symbolic expressions and BExpr represents a
matrix containing symbolic expressions.

These rules are meant to:

Keep function signatures as short as the official signatures available in the Matlab
documentation.
Provide implicit information about function inputs and outputs.

Note that these short-naming conventions are not the most usual in Matlab. Generally,
scalars, vectors and symbolic expressions are not differentiable (they are all written with a
lowercase letter).
When writing your own code, try to avoid short-naming variables, function inputs and
outputs. Instead, follow the guidelines in the Matlab programming style guidelines notes.

Trigonometry *
Y = sin(X)
Y = sind(X)
Y = cos(X)
Y = cosd(X)
Y = tan(X)
Y = tand(X)

1 / 4

Computer Programming

Bachelor in Aerospace Engineering


2012-2013

Exponential *
Y = exp(X)
Y = log(X)
Y = log10(X)
Y = log2(X)
Y = sqrt(X)
Y = nthroot(X, n)

Rounding and Remainder *


Y = ceil(X)
Y = floor(X)
Y = round(X)
R = rem(X, Y)

Complex *
Y = abs(X)
Y = sign(X)

Constants *
pi
eps
NaN
Inf

Discrete Math (1)


m = factorial(n)
G = gcd(A, B)

Symbolic Resolution
(syms )
exprOut = factor(expr)
m = limit(expr, n)
exprOut = int(expr)
exprOut = int(expr, n1, n2)

2 / 4

Computer Programming

Bachelor in Aerospace Engineering


2012-2013


In order to use the following functions, matrices must have been explained.

Basic Information *
Y = max(X)
Y = min(X)

Elementary Array Operations *


Y = sum(X)
Y = prod(X)

Analysis
n = det(A) *
n = rank(A)

Linear Equations
B = inv(A) *
X = linsolve(A, B) *
[L,U] = lu(A)

Discrete Math (2)


f = factor(n)
p = primes(n)
P = perms(v)
[n, m] = rat(X)
s = rat(X)

Polynomials
d = polyder(p)
y = polyval(p, n)
r = roots(p)
w = conv(p1, p2)
[q, r] = deconv(p1, p2)
p = poly(r)

Symbolic Resolution
(syms )
dExpr = det(AExpr)

3 / 4

Computer Programming

Bachelor in Aerospace Engineering


2012-2013


BExpr = inv(AExpr)
rExpr = solve(expr)

4 / 4

You might also like