Professional Documents
Culture Documents
A, B, C, D are matrices
A=eye (3) % generate a 3x3 Identity Matrix
B=zeros(2,4) % generate a 2x4 Zero matrix
C=ones(3,2) % generate a 3x2 matrix with one assigned to all elements
abs(x)
sign(x)
sqrt(x)
f
pow2(x,f)=x*2
exp(x) log(x) log10(x) log2(x)
sin(x) asin(x) csc(x) acsc(x)
cos(x) acos(x) sec(x) asec(x)
tan(x) atan(x) atan2(x,y) cot(x) acot(x)
sinh(x) asinh(x) csch(x) acsch(x)
cosh(x) acosh(x) sech(x) asech(x)
tanh(x) atanh(x) coth(x) acoth(x)
complex numbers:
real(z) imag(z) abs(z) conj(z) angle(z)
Signal Processing:
fft(x)
ifft(x) Inverse Fourier Transform
fft2(A) 2D FFT of matrix A
ifft2(A) Inverse 2D FFT
filter(b,a,x)
fftshift(x) shift the upper half of the series to become the lower part
PLOTTING
errorbar(x,y,e); % plots v vs x with error bars given by vector e
title(‘TEST PLOT’) % add a title centered at the top
xlabel(‘Time (sec)’); % add the x label
ylabel(‘Height (m)’); % add the y label
text(4,-1,’Wind’); % add text ‘Wind’ at position (x= 4, y= -1)
axis([xmin,xmax,ymin,ymax]); % set axis limits
axis on / off % set axis visibility on (or off)