Professional Documents
Culture Documents
a=[1,2,3] ans =
1 2 3
a=
1 2 3
b(:,1)
a' ans =
1
ans = 4
1 7
2
3
Task 2
b=[1;2;3] a=0:2:20
b= a=
1 0 2 4 6 8 10 12 14 16
2 18 20
3
b=1:2:20
a=[1 2 3]'
b=
a= 1 3 5 7 9 11 13 15 17
1 19
2
3
c=0:0.1:10
c=
b=[1 2 3;4 5 6;7 8 9]
b= Columns 1 through 13
1 2 3
4 5 6 0 0.1000 0.2000 0.3000
7 8 9 0.4000 0.5000 0.6000 0.7000
0.8000 0.9000 1.0000 1.1000
1.2000
Columns 14 through 26 9.5000 9.6000 9.7000 9.8000
9.9000 10.0000
1.3000 1.4000 1.5000 1.6000
1.7000 1.8000 1.9000 2.0000
2.1000 2.2000 2.3000 2.4000 Task 3:
2.5000
a=[1 2 3 5;2 8 9 7;6 4 3 2;7 2 1 2]
Columns 27 through 39
a=
1 2 3 5
2.6000 2.7000 2.8000 2.9000
2 8 9 7
3.0000 3.1000 3.2000 3.3000
6 4 3 2
3.4000 3.5000 3.6000 3.7000
7 2 1 2
3.8000
Columns 40 through 52
b=[8 2 3 1;5 4 9 6;3 2 1 4;4 2 1 4]
3.9000 4.0000 4.1000 4.2000 b=
4.3000 4.4000 4.5000 4.6000 8 2 3 1
4.7000 4.8000 4.9000 5.0000 5 4 9 6
5.1000 3 2 1 4
4 2 1 4
Columns 53 through 65
Task 4
Ra=round(a)
A=log(39)
Ra =
A= 2
3.6636
Ca=ceil(a)
B=log(55)
Ca =
B= 2
4.0073
Fa=floor(a)
C=log(2)
Fa =
C= 1
0.6931
b=0.0062
b=
Task 5: 0.0062
a=exp(23)
a= Rb=round(b)
9.7448e+09
Rb =
0
b=exp(-7)
b=
Cb=ceil(b)
9.1188e-04
Cb =
1 Documentation for exp
Other uses of exp
Fb=floor(b)
help log
Fb =
0 log Natural logarithm.
log(X) is the natural logarithm of the
elements of X.
Task 7: Complex results are produced if X is not
positive.
help ceil
ceil Round towards plus infinity. See also log1p, log2, log10, exp, logm,
ceil(X) rounds the elements of X to the reallog.
nearest integers
towards infinity. Documentation for log
Other uses of log
See also floor, round, fix.
help exp
exp Exponential.
exp(X) is the exponential of the
elements of X, e to the X.
For complex Z=X+i*Y, exp(Z) =
exp(X)*(COS(Y)+i*SIN(Y)).