Chapter 3 : Functions and Files Flashcards
absolute value of x
abs(x)
complex conjugate
conj(x)
imaginary part of a complex number x
imag(x)
real part of a complex number x
real(x)
round to the nearest integer toward infinty
ceil(x)
round to the nearest integer towards zero
fix(x)
round to the nearest integer toward negative infinity
floor(x)
round to the nearest integer
round(x)
sign(x)
signum function:
+1 if x>0
0 if x=0
-1 if x<0
angle of a complex number
angle(x)
cosh(x)
hyperbolic cosine
cosh x = (e^x + e^-x)/2
acosh(x)
inverse hyperbolic cosine
create a function (a .m file)
function [output variables] = function_name (input variables)
the initial text for a function in the main program
[output] = file_name (input)
how to upload an xls
A = xlsread(‘filename’)