0% found this document useful (0 votes)
16 views

MATLAB 5.1 - Linear Combination-Group-2

The document lists four examples checking if a vector v can be written as a linear combination of vectors in a set S using MATLAB. Examples 1 and 3 are inconsistent, while examples 2 and 4 have coefficient solutions, so not all vectors can be written as a linear combination.

Uploaded by

JHON ROY OLIVA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

MATLAB 5.1 - Linear Combination-Group-2

The document lists four examples checking if a vector v can be written as a linear combination of vectors in a set S using MATLAB. Examples 1 and 3 are inconsistent, while examples 2 and 4 have coefficient solutions, so not all vectors can be written as a linear combination.

Uploaded by

JHON ROY OLIVA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

NAME : BUENVIAJE, ANTOINETTE LEXA SECTION: CE21S19

GIMENEZ, ANGELICA JOY


OLIVA, JHON ROY
RODIL, PRECIOUS JAMIE

MATLAB ACTIVITY 5.1 Linear Combination

A. Use appropriate MATLAB syntax to determine whether v can be written as a linear combination
of the given set of vectors. Write your answer in the space provided. (Hint : Reshape Matrix)

1. 𝑣 = [0 1 1 1] 𝑎𝑛𝑑 𝑆 = {[1 0 1 0] , [0 1 1 0], [1 1 1 1] }


−2 −1 2 −1
2. 𝑣 = [ 5 ] 𝑎𝑛𝑑 𝑆 = {[ 8 ] , [−1] , [ 2 ] }
0 3 0 1
0 2 −1 2 −3 0
3. 𝑣 = 𝐼2 𝑎𝑛𝑑 𝑆 = {[ ],[ ],[ ]}
3 1 2 1 1 1
4. 𝑣 = 𝑓(𝑥) = 3𝑥 + 𝑥 − 3 𝑎𝑛𝑑 𝑆 = {2𝑥 − 𝑥 + 1 , 𝑥 2 − 2, 𝑥 − 1}
2 2

MATLAB Syntax MATLAB Output Linear Combination

V1=[0, 1, 1, 1]' V1 = INCONSISTENT

0 1

S1=[1, 0, 1, 0,; 0, 1, 1, 0; 1, 1, 1, 1]' 1 1

S1 =

rref ([S1 V1])

1 0 1

0 1 1

1 1 1

0 0 1

ans =
1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

2. V2=[-2, 5, 0]' V2 = 𝑽=

-2 𝟒/𝟑𝑺𝟏−𝟕/𝟑𝑺𝟐−𝟒𝑺𝟑

S2=[-1 2 -1; 8 -1 2; 3, 0, 1] 5

rref([S2 V2]) S2 =

-1 2 -1

8 -1 2

3 0 1

ans =

1 0 0 4/3

0 1 0 -7/3

0 0 1 -4
3. V3 = INCONSISTENT

>V3=[1;0;0;1]

S3=[0 -1 -3;2 2 0;3 2 1;1 1 1] 0

rref([S3 V3]) 1

S3 =

0 -1 -3

2 2 0

3 2 1

1 1 1

ans =

1 0 0 0

0 1 0 0
0 0 1 0

0 0 0 1

4. V4 = V=

>V4=[9;1;3] 9 11/4S1-2S2+15/4S3

S4=[4 1 0;-1 0 1;1 -2 -1] 3

rref([S4 V4]) S4 =

4 1 0

-1 0 1

1 -2 -1

ans =

1.0000 0 0 2.7500

0 1.0000 0 -2.0000

0 0 1.0000 3.7500

Observing from the results of this task, are all vectors can be written as linear combination? explain your
answer briefly

Observing the results, it can be seen that numbers 1 and 3 are inconsistent while 2
and 4 has coefficient numbers that is considered as a linear combination. Therefore,
not all vectors can be written as a linear combination.
Command History
Honor Pledge: We accept the responsibility for our role in ensuring the integrity of the work
submitted by the group in which we participated.
OLIVA, JHON ROY

GIMENEZ, ANGELICA JOY RODIL, PRECIOUS JAMIE

You might also like