Professional Documents
Culture Documents
NCKU ICLab
(2017/3/6) Even
: >> (5*2+3.5)/5
ans =2.7000
Ex1: c999 o
c_999 o
4c999 X
c-999 X
MATLAB
Variable Declaration
(double) 5
: command window
: x=1+2+3 ...
+4;
6
help :
lookfor
help
abs(x) :
acos(x) :
cos(x) : cos(x)
sqrt(x) :
log(x) :
log10(x) :
round(x) : ( )
real(x) :
imag(x) :
exp(x) :
8
Example 1 : y =
y = exp(-5)*(cosd(5)/asind(0.6));
Example 2 : y=sin
y = sin (30/180*pi); %(rad)
y = sind (30); %(deg)
Example 3 :
y=100^3;
(vector)
Example : A=[1 4 6 8 5 6];
(matrix)
Example : A= [1 2 3 ; 4 5 6 ; 7 8 9] (3x3 matrix)
10
11
12
13
14
15
A(2,2) = 5
A(2,2:3) = 5 6
A= ( )
16
B= [4 5 6 ; 7 9 9 ; 1 2 3] B=
C=A+B C=
D=A-B D=
17
B= [9 ; 1 ; 0] B=
18
19
20