0% found this document useful (0 votes)
44 views5 pages

Lcs Lab#1 Tasks: Submitted To: Sir G.M Abro

This document appears to be a lab report submitted by [Company Name] to Sir G.M. Abro. It contains the results of tasks completed on Lab #1. The tasks involve performing various matrix operations and functions in MATLAB, including multiplying matrices, calculating inverses, eigenvalues, and more. The document provides the MATLAB code used and results returned for each task.

Uploaded by

Farhamand Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views5 pages

Lcs Lab#1 Tasks: Submitted To: Sir G.M Abro

This document appears to be a lab report submitted by [Company Name] to Sir G.M. Abro. It contains the results of tasks completed on Lab #1. The tasks involve performing various matrix operations and functions in MATLAB, including multiplying matrices, calculating inverses, eigenvalues, and more. The document provides the MATLAB code used and results returned for each task.

Uploaded by

Farhamand Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

[TYPE THE COMPANY NAME]

LCS LAB#1
TASKS
SUBMITTED TO: SIR G.M
ABRO
FARHAMAND KHAN CMS: 1699-2016
3/14/2019

[Type the abstract of the document here. The


abstract is typically a short summary of the
contents of the document. Type the abstract of
the document here. The abstract is typically a
short summary of the contents of the
document.]
LAB#01

TASK 1: H=

>> B = [60:1:70] 2

B= 3

Columns 1 through 9 3

60 61 62 63 64 65 66 67 68 4

Columns 10 through 11 >> X=[2 2 2; 3 3 3; 4 4 4];

69 70 >> T=H(2,1)+X

>> V = [3 3 3; 4 4 4; 5 5 5]; T=

>> G = [3 5 6; 3 8 9; 9 5 4]; 5 5 5

>> Y = V*G 6 6 6

Y= 7 7 7

45 54 57 >> T=H(2,1)-X

60 72 76 T=

75 90 95 1 1 1

>> Y = V*G(1:3)' 0 0 0

Y= -1 -1 -1

45 >> K=eye(3)

60 K=

75 1 0 0

>> H=[2 3 4 6; 5 4 3 5; 6 7 8 3; 8 7 4 8] 0 1 0

H= 0 0 1

2 3 4 6 >> T=[1 ones(1,5) zeros(1,3)]

5 4 3 5 T=

6 7 8 3 Columns 1 through 8

8 7 4 8 1 1 1 1 1 1 0 0

>> H= [2:3,3:4]' Column 9

>> T=rand(3)

T=
LAB#01
0.8147 0.9134 0.2785 >> V^2

0.9058 0.6324 0.5469 ans =

0.1270 0.0975 0.9575 36 36 36

>> S=magic(4) 48 48 48

S= 60 60 60

16 2 3 13 >> V*V

5 11 10 8 ans =

9 7 6 12 36 36 36

4 14 15 1 48 48 48

>> R=eig(eye(4)) 60 60 60

R= (V^2=V*V PROVED)

1 >> V./G

1 ans =

1 1.0000 0.6000 0.5000

1 1.3333 0.5000 0.4444

>> U=round([-1.2 -2.5 -3.5 1.2 3.5 3.9 4.6]) 0.5556 1.0000 1.2500

U= >> G.\V

-1 -3 -4 1 4 4 5 ans =

>> X=abs(U) 1.0000 0.6000 0.5000

X= 1.3333 0.5000 0.4444

1 3 4 1 4 4 5 0.5556 1.0000 1.2500

>> U=floor([-1.2 -2.5 -3.5 1.2 3.5 3.9 4.6]) (V./G = G.\V PROVED)

U= >>

-2 -3 -4 1 3 3 4

>> U=ceil([-1.2 -2.5 -3.5 1.2 3.5 3.9 4.6])

U=

-1 -2 -3 2 4 4 5
LAB#01

TASK 2: >>eig(A)

>>A ans =

A= 8.8343

1 3 5 2.0426

2 -2 -6 -4.8768

4 0 7 >>

>>size(A) >>sin(A)

ans = ans =

3 3 0.8415 0.1411 -0.9589

>>det(A) 0.9093 -0.9093 0.2794

ans = -0.7568 0 0.6570

-88 >>asin(A)

>> ans =

>>inv(A) 1.5708 + 0.0000i 1.5708 - 1.7627i 1.5708 -


2.2924i
ans =
1.5708 - 1.3170i -1.5708 + 1.3170i -1.5708 +
0.1591 0.2386 0.0909 2.4779i
0.4318 0.1477 -0.1818 1.5708 - 2.0634i 0.0000 + 0.0000i 1.5708 -
-0.0909 -0.1364 0.0909 2.6339i

>>length(A) >>sqrt(A)

ans =
ans =

3 1.0000 + 0.0000i 1.7321 + 0.0000i 2.2361 +


0.0000i
>>diag(A)
1.4142 + 0.0000i 0.0000 + 1.4142i 0.0000 +
ans = 2.4495i

2.0000 + 0.0000i 0.0000 + 0.0000i 2.6458 +


0.0000i
1

-2

7
LAB#01
>>log10(A)

ans = >> C=inv(A)

0.0000 + 0.0000i 0.4771 + 0.0000i 0.6990 + C


0.0000i
-0.1667 0.5000 -0.3333
0.3010 + 0.0000i 0.3010 + 1.3644i 0.7782 +
-1.4167 0.7500 0.1667
1.3644i
1.0833 -0.7500 0.1667
0.6021 + 0.0000i -Inf + 0.0000i 0.8451 +
0.0000i >>

>> D=C*B
>>log(A) D=

-0.3333
ans = 0.1667

1.1667 (ANSWERS)
0.0000 + 0.0000i 1.0986 + 0.0000i 1.6094 + >>
0.0000i

0.6931 + 0.0000i 0.6931 + 3.1416i 1.7918 +


3.1416i

1.3863 + 0.0000i -Inf + 0.0000i 1.9459 +


0.0000i

TASK 3:
>> A=[3 2 4;5 4 6; 3 5 7]

A=

3 2 4

5 4 6

3 5 7

>> B=[4;6;8]

B=

You might also like