5. Let S be the standard basis for R5. Let B {bi, b2, b3,b4P5} be the ordered ba
ID: 3589756 • Letter: 5
Question
5. Let S be the standard basis for R5. Let B {bi, b2, b3,b4P5} be the ordered basis with bi = (2, 1,1,-2,-2) b2 = (0,-2, 4, 5,-4) by = (1,-4, 5, 5,-4) b4 = (5,-4, 2, 3, 1) bs = (4, 1, 2,-3,-2) Enter these vectors into Matlab. (a) Form the transition matrix P - Ps,s and use it to calculate the coordinate matrix of the vector v (1,1,2,0,3) with respect to B. (There is no need to write down P on the answer paper.) (b) A linear transformation T : R5 R5 is given by: Write down the matrix representation of T with respect to S [T]s = (c) Find the matrix representation T]s of T with respect to B. Write down the (1,2) and (5,3) [T]B(5,3) =Explanation / Answer
%defining P vector >> P = [4 zeros(1,4) 7*ones(1,5);0 4 zeros(1,3) 7*ones(1,5);0 0 4 0 0 7*ones(1,5); 0 0 0 4 0 7*ones(1,5);00 0 0 0 4 7*ones(1,5);12*ones(1,5) 1 7 7 7 7;12*ones(1,5) 7 1 7 7 7;12*ones(1,5) 7 7 1 7 7;12*ones(1,5) 7 7 7 1 7; 12*ones(1,5) 7 7 7 7 1] P = 4 0 0 0 0 7 7 7 7 7 0 4 0 0 0 7 7 7 7 7 0 0 4 0 0 7 7 7 7 7 0 0 0 4 0 7 7 7 7 7 0 0 0 0 4 7 7 7 7 7 12 12 12 12 12 1 7 7 7 7 12 12 12 12 12 7 1 7 7 7 12 12 12 12 12 7 7 1 7 7 12 12 12 12 12 7 7 7 1 7 12 12 12 12 12 7 7 7 7 1 %below code return third row >> P(3,:) ans = 0 0 4 0 0 7 7 7 7 7 %below code returns 5th column >> P(:,5) ans = 0 0 0 0 4 12 12 12 12 12 %below code snippet is called matrix multiplication and gives dot product of row and column vector >> P(3,:)*P(:,5) ans = 420 %calculating Q inv(matrix) gives matrix-1 >> Q = 2*inv(P) Q = Columns 1 through 6: 0.3941532 -0.1058468 -0.1058468 -0.1058468 -0.1058468 0.0070565 -0.1058468 0.3941532 -0.1058468 -0.1058468 -0.1058468 0.0070565 -0.1058468 -0.1058468 0.3941532 -0.1058468 -0.1058468 0.0070565 -0.1058468 -0.1058468 -0.1058468 0.3941532 -0.1058468 0.0070565 -0.1058468 -0.1058468 -0.1058468 -0.1058468 0.3941532 0.0070565 0.0120968 0.0120968 0.0120968 0.0120968 0.0120968 -0.2674731 0.0120968 0.0120968 0.0120968 0.0120968 0.0120968 0.0658602 0.0120968 0.0120968 0.0120968 0.0120968 0.0120968 0.0658602 0.0120968 0.0120968 0.0120968 0.0120968 0.0120968 0.0658602 0.0120968 0.0120968 0.0120968 0.0120968 0.0120968 0.0658602 Columns 7 through 10: 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0070565 0.0658602 0.0658602 0.0658602 0.0658602 -0.2674731 0.0658602 0.0658602 0.0658602 0.0658602 -0.2674731 0.0658602 0.0658602 0.0658602 0.0658602 -0.2674731 0.0658602 0.0658602 0.0658602 0.0658602 -0.2674731 octave:8> det(P*Q) ans = 1024.0 %below code is nothing but P+6I where I is identity matrix %in matlab we can create identity matrix using eye function eye(20) returns %an identity matrix with size 10 by 10 >> P+(6*eye(10)) ans = 10 0 0 0 0 7 7 7 7 7 0 10 0 0 0 7 7 7 7 7 0 0 10 0 0 7 7 7 7 7 0 0 0 10 0 7 7 7 7 7 0 0 0 0 10 7 7 7 7 7 12 12 12 12 12 7 7 7 7 7 12 12 12 12 12 7 7 7 7 7 12 12 12 12 12 7 7 7 7 7 12 12 12 12 12 7 7 7 7 7 12 12 12 12 12 7 7 7 7 7 %rank function provides rank of given matrix >> rank(P+(6*eye(10))) ans = 6 %taking the third column of P and saving it as a >> a = P(:,3) a = 0 0 4 0 0 12 12 12 12 12 %taking the sixth column of P and saving it as b >> b = P(:,6) b = 7 7 7 7 7 1 7 7 7 7 %taking the third row of P and saving it as c >> c = P(3,:) c = 0 0 4 0 0 7 7 7 7 7 %since c is row vector and for matrix addition dimension should agree %so we need to convert that row vector in column vector >> c = c' c = 0 0 4 0 0 7 7 7 7 7 %linear combination calculated as >> lc = -a+(2*b)+(2*c) lc = 14 14 18 14 14 4 16 16 16 16
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.