Sunteți pe pagina 1din 6

Task Description

This lab provides basic information of matlab built in functions also it provides a knowledge to export

data from excel into matlab and performing operation on it

Learning Objectives

 Matlab builtin function will be explored

 Data will be imported from excel to Matlab

 TSome of the basic operation like manipulation of matrices will be done

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

0 + 1.4142i 0 + 1.0000i 0 1.0000

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

0.6931 + 3.1416i 0 + 3.1416i -Inf 0

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 =

-5.0000 -3.5000 -2.0000 -0.5000 1.0000 2.5000 4.0000 5.5000


II b=mod(y,2)
b=

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

0 0.6283 1.2566 1.8850 2.5133 3.1416 3.7699 4.3982 5.0265

Columns 10 through 11

5.6549 6.2832

ans =

Columns 1 through 9

1.0000 0.8090 0.3090 -0.3090 -0.8090 -1.0000 -0.8090 -0.3090 0.3090

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

-1.0000 -0.8000 -0.6000 -0.4000 -0.2000 0 0.2000 0.4000 0.6000

Columns 10 through 11

0.8000 1.0000

ans =

Columns 1 through 9

180.0000 143.1301 126.8699 113.5782 101.5370 90.0000 78.4630 66.4218 53.1301

Columns 10 through 11
36.8699 0
h cos(45)
ans =

0.5253

Part 2

A x=[4 90 85 75;2 55 65 75;3 78 82 79;1 84 92 93]


x=

4 90 85 75
2 55 65 75
3 78 82 79
1 84 92 93

B M=mean(x)
M=

2.5000 76.7500 81.0000 80.5000


C Me=median(x)
Me =

2.5000 81.0000 83.5000 77.0000


D M=mean(x,2)
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 =

10 307 324 322


J prod(x)

ans =

24 32432400 41680600 41326875


K sort(x)
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.

S-ar putea să vă placă și