MAT350 4.3 MATLAB: Span
In this activity you will determine if a set of vectors spans a space and determine if a given vector is in the span of a set of vectors.
Consider the set of vectors in.
5 2 3 0
v1 = [ 4 ], v2 = [ 1], v3 = [ 1 ], v4 = [ 2 ]
2 -1 -3 6
A vector is an ordered n-tuple that can be represented as a row or column vector. Here the vectors are rows.
v1 = [5 4 2]
v2 = [2 1 -1]
v3 = [3 1 -3]
v4 = [0 2 6]
To determine if this set of vectors spans 3-space, first create a matrix C consisting of the column vectors.
Note, the vectors were created as row vectors. Use the dot-tic operator to make them column vectors.
Alternatively, you can create the vectors as column vectors to avoid using the dot-tic operator.
C = [v1.’ v2.’ v3.’ v4.’]
For vectors in 3-space, the reduced matrix will have three pivot columns if the vectors span 3-space.
reducedC = rref(C)
For this example, the reduced matrix has only two pivot columns, so the set of vectors does not span 3-space.
Consider the vector u=[2 1 1]. To determine if u is in the span of the given vectors,
create an
augmented matrix [C|u].
u = [2 1 1]
Cu = [C u.’ ]
If a solution to the system Cx=u exists, then u is in the span of the vectors.
reducedCu = rref(Cu)
For this example, the reduced matrix has no solution to the system Cx=u, so u is not in the span of the vectors.
Utilize the following set of vectors in for this activity.
1 2 1 0
v1 = [0 ], v2= [-2 ], v3= [ -1 ], v4= [ -1 ]
1 3 1 1
1 2 0 1
Enter vectors v1, v2, v3, and v4 as row vectors.
v1 = [1, 0, 1, 1]
v2 = [2, -2, 3, 2]
v3 = [1, -1, 1, 0]
v4 = [0, -1, 1, 1]
Create a matrix A consisting of these vectors as column vectors.
A = [v1′, v2′, v3′, v4′];
disp(A)
For vectors in 4-space, the reduced matrix will have four pivot columns if the vectors span 4-space.
Find the reduced matrix, storing it in reducedA. Do the vectors span 4-space?
reducedA = rref(A);
disp(reducedA)
Create the vector w=[2 1 1 1].
w = [2, 1, 1, 1]
Create an augmented matrix [A|w], storing it in Aw.
Aw = [A, w’];
disp(Aw)
Find the reduced matrix, storing it in reducedAw. Is w is in the span of the vectors?
reducedAw = rref(Aw);
disp(reducedAw)
Related; MAT350 4.13 MATLAB: Rank and Null Space.
Order This Paper
Reviews
There are no reviews yet.