Question

We will be working with the following matrix [1 2 3 0 0 0 0 2 1 2 3 0 0 0 3 2 1 2 3 0 0 0 3 2 1 2 3 0 0 0 3 2 1 2 3 0 0 0 3 2

Intro Step 11

11. MATLAB M-files - There are two types of M-files that are typically utilized when using MatLab. We will learn more about t

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Script:

close all
clear
clc

fprintf('Part 1\n---------------------------------------\n')
A = [1 2 3 0 0 0 0 0;
2 1 2 3 0 0 0 0;
3 2 1 2 3 0 0 0;
0 3 2 1 2 3 0 0;
0 0 3 2 1 2 3 0;
0 0 0 3 2 1 2 3;
0 0 0 0 3 2 1 2;
0 0 0 0 0 3 2 1];
detA = det(A);
fprintf('det(A) = %-20.2f\n', detA)

fprintf('\nPart 2\n---------------------------------------\n')
invA = inv(A);
disp('inv(A) ='), disp(invA)

fprintf('\nPart 3\n---------------------------------------\n')
b = [2 4 8 16 32 61 128 256]';
x = A\b;
disp('Solution, x ='), disp(x)

fprintf('\nPart 4\n---------------------------------------\n')
x10 = evec(A, b, 10);
x100 = evec(A, b, 100);
disp('Approximate Eigenvector (after 10 iterations with b) ='), disp(x10)
disp('Approximate Eigenvector (after 100 iterations with b) ='), disp(x100)

r = rand(size(b)); % Random vector
x10 = evec(A, r, 10);
x100 = evec(A, r, 100);
disp('Approximate Eigenvector (after 10 iterations with random vector) ='), disp(x10)
disp('Approximate Eigenvector (after 100 iterations with random vector) ='), disp(x100)

function [x] = evec(A,x,n)
for i = 1:n
x = A*x;
x = x/norm(x);
end
end

Output:

Command Window Part 1 det(A) = 4641.00 Part 2 0 inv(A) = 0.0623 0.2051 0.1758 -0.2271 -0.1962 -0.1758 0.1282 0.2711 0.2051 -0Part 4 Approximate Eigenvector (after 10 iterations with b) = @.2088 0.2972 0.4020 0.4458 0.4479 0.4093 0.3047 0.2163 Approxi

Add a comment
Know the answer?
Add Answer to:
Intro Step 11 We will be working with the following matrix [1 2 3 0 0...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Let A be an invertiblen x n matrix and be an eigenvalue of A. Then we...

    Let A be an invertiblen x n matrix and be an eigenvalue of A. Then we know the following facts. 1) We have jk is an eigenvalue of A* 2) We have 1 -1 is an eigenvalue of A-1 If 1 = 5 is an eigenvalue of the matrix A, find an eigenvalue of the matrix (A? +41) -'. Enter your answer using three decimal places. Hint: First find an eigenvalue of A² +41. You might do this by assuming...

  • Problem 1: The matrix e^A is defined by the Mclaurin series e^A=1+A/1!+A^2/2!+A^3/3!+........+A^n/n! This computation ca...

    Problem 1: The matrix e^A is defined by the Mclaurin series e^A=1+A/1!+A^2/2!+A^3/3!+........+A^n/n! This computation can be quite difficult, as this problem illustrates. a)Enter the function function E=matexp(A) E=zeros(size(A)); F=eye(size(A)); k=1; while norm (E+F-E,1) > 0 E=E+F; F=A*F/k; k=k+a; end that estimates e^A using Mclaurin series. b)Apply matexp to the matrix a=[99 -100; 137 -138] to obtaion matrix A_Mclaurin c)A_Mclaurin is far from the correct result.ompute the true value of e^A using the MATLAB function expm as follows: >>showdemo expmdemo The...

  • is an eigenvalue invertible matrix with X as an eigenvalue. Show that of A-1. Suppose v...

    is an eigenvalue invertible matrix with X as an eigenvalue. Show that of A-1. Suppose v ER is a nonzero column vector. Let A (a) Show that v is an eigenvector of A correspond zero column vector. Let A be the n xn matrix vvT. n eigenvector of A corresponding to eigenvalue = |v||2. lat O is an eigenvalue of multiplicity n - 1. (Hint: What is rank A?) (b) Show that 0 is an eigenvalue of

  • The 2 x 2 matrix 1 = ( 43 II has two distinct real eigenvalues. 1....

    The 2 x 2 matrix 1 = ( 43 II has two distinct real eigenvalues. 1. Give the characteristic polynomial for A in Maple notation in the form t^2 + a*t + b Characteristic polynomial = 2. Find the set of eigenvalues for A, enclosed in braces , ) with the two eigenvalues separated by a comma, like (-4, 7) Set of eigenvalues for A = 5 3. Find one eigenvector for each eigenvalue, using Maple > for vectors, e.g....

  • Math 3377Quiz 6 Answer the following for the matrix M: 1 2 3 M-0 2 1...

    Math 3377Quiz 6 Answer the following for the matrix M: 1 2 3 M-0 2 1 0 0 3 1. What is the characteristic polynomial of M? 2. What are the eigenvalues of M? 3. Show that is an eigenvector of M. What is its eigenvalue? 0

  • The matrix A= is diagonalisable with eigenvalues 1, -2 and -2. An eigenvector corresponding to the...

    The matrix A= is diagonalisable with eigenvalues 1, -2 and -2. An eigenvector corresponding to the eigenvalue 1 is . Find an invertible matrix M such that M−1AM= ⎛⎝⎜⎜⎜1000-2000-2⎞⎠⎟⎟⎟. Enter the Matrix M in the box below. Question 8: Score 0/2 1 3 -3 4 6 -6 8 The matrix A = 1-6 6 | is diagonalisable with eigenvalues 1,-2 and-2. An eigenvector corresponding to the eigenvalue 1 is -2 2 1 0 0 0 0-2 Find an invertible matrix...

  • on matlab (1) Matrices are entered row-wise. Row commas. Enter 1 2 3 (2) Element A,...

    on matlab (1) Matrices are entered row-wise. Row commas. Enter 1 2 3 (2) Element A, of matrix A is accesser (3) Correcting an entry is easy to (4) Any submatrix of Ais obtained by d row wise. Rows are separated by semicolons and columns are separated by spaces ner A l 23:45 6. B and hit the return/enter kry matrix A is accessed as A Enter and hit the returnerter key an entry is easy through indesine Enter 19...

  • 0 -2 - The matrix A -11 2 2 -1 has eigenvalues 5 X = 3,...

    0 -2 - The matrix A -11 2 2 -1 has eigenvalues 5 X = 3, A2 = 2, 13 = 1 Find a basis B = {V1, V2, v3} for R3 consisting of eigenvectors of A. Give the corresponding eigenvalue for each eigenvector vi.

  • Find (as a unit vector with negative first term) an eigenvector of the matrix corresponding to...

    Find (as a unit vector with negative first term) an eigenvector of the matrix corresponding to the eigenvalue lambda = 2 2 – 30 – 6 Find (as a unit vector with negative first term) an eigenvector of the matrix 0 2 0 corresponding to the eigenvalue 1 = 2 0 - 6 4 -4 1/3 x Preview Answer: 6V154 77 V154 154 3V154 154

  • Review 4: question 1 Let A be an n x n matrix. Which of the below...

    Review 4: question 1 Let A be an n x n matrix. Which of the below is not true? A. A scalar 2 is an eigenvalue of A if and only if (A - 11) is not invertible. B. A non-zero vector x is an eigenvector corresponding to an eigenvalue if and only if x is a solution of the matrix equation (A-11)x= 0. C. To find all eigenvalues of A, we solve the characteristic equation det(A-2) = 0. D)....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT