Task Description
Task Description
This lab provides basic information of matlab built in functions also it provides a knowledge to export
Learning Objectives
Approach
The data will be imported from excel to MAtlab and operation will be performed on it using Matlab
builtin functions
Question Responses
a x=[-2:1:2]
x=
-2 -1 0 1 2
I abs(x)
ans =
2 1 0 1 2
II sqrt(x)
ans =
Columns 1 through 4
Column 5
1.4142
III exp(x)
ans =
0.1353 0.3679 1.0000 2.7183 7.3891
IV log(x)
ans =
Columns 1 through 4
Column 5
0.6931
V sign(x)
ans =
-1 -1 0 1 1
b y=[-10:3:11]
y=
-10 -7 -4 -1 2 5 8 11
I y/2
ans =
0 1 0 1 0 1 0 1
C F=factor(322)
F=
2 7 23
D theta=3*pi
sin(2*theta)
theta =
9.4248
ans =
-7.3479e-016
e theta=[0:0.2*pi:2*pi]
cos(theta)
theta =
Columns 1 through 9
Columns 10 through 11
5.6549 6.2832
ans =
Columns 1 through 9
Columns 10 through 11
0.8090 1.0000
f asind(1)
ans =
90
g theta=[-1:0.2:1]
acosd(theta)
Columns 1 through 9
Columns 10 through 11
0.8000 1.0000
ans =
Columns 1 through 9
Columns 10 through 11
36.8699 0
h cos(45)
ans =
0.5253
Part 2
4 90 85 75
2 55 65 75
3 78 82 79
1 84 92 93
B M=mean(x)
M=
63.5000
49.2500
60.5000
67.5000
E M=median(x,2)
M=
80.0000
60.0000
78.5000
88.0000
F mean(mean(x))
ans =
60.1875
G 4
H max(max(x))
ans =
93
I sum(x)
ans =
ans =
1 55 65 75
2 78 82 75
3 84 85 79
4 90 92 93
Part c
a. Sum(x)
98
19
391
331
287
158
232
163
59
34
b. Sum(sum(x))
1755
c. Z11
Conclusions
The data is imported from Excel to Matlab and operation is performed on it using built in Matlab
functions.