Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this activity, we will do operations on vectors. Furthermore, we find the linear combination of a vector in terms of a given set of

In this activity, we will do operations on vectors. Furthermore, we find the linear combination of a vector in terms of a given set of vectors.
Suppose that the vectors are linearly independent and is a given vector. This code will find the constants such that if is dependent of . Otherwise, this code will output null.
Given the vectors:
First part: Arithmetic on vectors
Compute the scaled vectors below and put your answers in , respectively.
Compute the different resultants:
Compute the linear combinations:
Second Part: Finding the linear combination of the vector w0 in terms of the vectors in terms of the generators w1, w2, and w3.
Step 1: Encode the vectors as column vectors. This is done by puttiing (') at the end of the vector.
For instance, we write
v1=[-1,1,-1]'
as opposed to just
v1=[-1,1,-1]
Step 2: Augment the given generator vectors into a matrix by using the code
.
Step 3: Augment the matrix A and v_0 and call the matrix Aw.
Step 4: Find the reduce reduced-row echelon form of the matrix Av using the code:
rref(Aw)
and put the answer in rrefAw.
Step 5: Extract the end-column of the matrix Av using the code:
Root = rrefAw(:, end)
Step 6: The obtain the matrix back, use the code
AL = rrefAw(:,1:end-1)
Step 8: The last code below determines whether the constants are found or not.
if AL == eye(size(AL))
c1= Root(1)
c2= Root(2)
c3= Root(3)
else
display("No Roots Found")
c1= NaN;
c2= NaN;
c3= NaN;
end
%FIRST PART
%Encoding and Converting the Vectors as column Vector
v1=
v2=
v3=
%Computation of the scaled vectors
v4=
v5=
v6=
%Computation of resultants
v7=
v8=
%Computation of linear combinations
v9=
v10=
v11=
%SECOND PART
%Encode the vectors as colum vectors
w0=
w1=
w2=
w3=
%Augment the given vectors w1, w2 and w3 as a single matrix A
%Augment A and w0 and express as reduced row echelon form.
%Extract the column matrix and the remaining matrix
if AL == eye(size(AL))
c1= Root(1)
c2= Root(2)
c3= Root(3)
else
display("No Roots Found")
c1= NaN;
c2= NaN;
c3= NaN;
end
%Check of the result
%Compute the linear combination of the vectors w1, w2, and w3 using the obtained values for the constants and call the answer w
w =
w0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions