Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. In this question, we will utilize proposition 7. to investigate linear algebr

ID: 3699680 • Letter: 1

Question

1. In this question, we will utilize proposition 7. to investigate linear algebra techniques applied to efficiency in code. Input the following matrix into MATLAB 25 .05 A= .15 .35 15-05 .2 a. Create a for loop to calculate A1021 b. Time the above for loop by using the MATLAB tic toc ability c. Store the time it takes to complete the loop as the variable t1 d. Calculate the eigenvectors and eigenvalues for the matrix A. Store the eigenvectors as P and the cigenvalues as D e. Calculate the inverse of P f. Calculate A01 by using the diagonalization method g. Time the above calculation using the MATLAB tic toc ability and store the time it takes as the variable t2 h. Using the MATLAB function fprintf report thefolowing: Computation time to calculate A024 using Ordinary Multiplication is: Computation time to calculate A024 using Diagonalization is: . Diagonalization Method is faster by a factor ofan Ordinary Multiplication Report all times to the 8th decimal place. To find "faster by a factor of , divide the fastest time by the slowest time

Explanation / Answer

SAVE THE FOLLOWWING CODE IN MATLAB AND GET THE RESULTS.
clc
clear
close all;
A=[0.25 0.05 -0.1;0.15 0.35 0.1;-0.15 -0.05 0.2];
[r,c]=size(A);
%% Part (A) and (B) and (C)
tic
for i=1:r
for j=1:c
A1(i,j)=A(i,j).^1024;
end
end
t1=toc;
disp('The time takes to complete the loop is')
disp(vpa(t1,6))
%% Part (D)
[P,D]=eig(A);
%% Part (E)
Inverse_of_P=inv(P);
%% Part (F) and (G)
tic
A_1024=A./1024;
t2=toc;
%% Part (H)
S=34;
fprintf('The time to calculate the A^1024 uisng ordinay multiplication is %d ',t1)
fprintf('The time to calculate the A^1024 uisng ordinay multiplication is %d ',t2)
fprintf('Diagonalization method is faster then Ordinary multiplication by a factor of %d ',S)