Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question gives you a chance to work with the concept of spectral decomposition in a more intuitive way, using pictures. Matlab has a built-in

image text in transcribed

This question gives you a chance to work with the concept of spectral decomposition in a more intuitive way, using pictures. Matlab has a built-in test pattern image that we can use for this. Use the command x=double(imread('testpati.png')); to obtain a matrix X that is very close to being a symmetric matrix. Unfortunately, due to compression errors, X is not exactly symmetric, but we can derive a matrix A that is very similar in appearance to X and is symmetric by adding X to its transpose. It's also handy to normalize so that the entries of A are between 0 and 1: A=(X+X')/(2*max(max(x))); You can view X and A using the command imshow(); and you can verify that A is a symmetric matrix using: isequal(A,A') Now, use Matlab to compute the eigenvalues and eigenvectors of A: [V,D]=eig(A); The matrix D will contain the eigenvalues and the matrix V will contain corresponding unit length basis vectors for the associated eigenspaces. Because D is a diagonal matrix, most of its entries are 0. An easy way to look at the diagonal entries of D is to type max (D). This will print the largest entries in each column of D. You can then see that Matlab has created D with the eigenvalues ordered in increasing magnitude along the main diagonal. This question gives you a chance to work with the concept of spectral decomposition in a more intuitive way, using pictures. Matlab has a built-in test pattern image that we can use for this. Use the command x=double(imread('testpati.png')); to obtain a matrix X that is very close to being a symmetric matrix. Unfortunately, due to compression errors, X is not exactly symmetric, but we can derive a matrix A that is very similar in appearance to X and is symmetric by adding X to its transpose. It's also handy to normalize so that the entries of A are between 0 and 1: A=(X+X')/(2*max(max(x))); You can view X and A using the command imshow(); and you can verify that A is a symmetric matrix using: isequal(A,A') Now, use Matlab to compute the eigenvalues and eigenvectors of A: [V,D]=eig(A); The matrix D will contain the eigenvalues and the matrix V will contain corresponding unit length basis vectors for the associated eigenspaces. Because D is a diagonal matrix, most of its entries are 0. An easy way to look at the diagonal entries of D is to type max (D). This will print the largest entries in each column of D. You can then see that Matlab has created D with the eigenvalues ordered in increasing magnitude along the main diagonal

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

Accounting For Managers Text And Cases

Authors: William J. Bruns

3rd Edition

0324291213, 978-0324291216

More Books

Students also viewed these Accounting questions

Question

=+which it operates?

Answered: 1 week ago

Question

=+How should we organize a book to maximize learning and interest

Answered: 1 week ago