Question: Matlab a 3. A magic matrix is a square matrix with the property that each row, each column and each diagonal have the same sum.
a 3. A magic matrix is a square matrix with the property that each row, each column and each diagonal have the same sum. Create a 5 x 5 magic matrix named a. Answer the following with supporting evidence. (40 points) a. Is a times a constant such as 2 also a magic matrix? b. If you square each element of a, is the new matrix a magic matrix? c. If you add a constant to each element, is the new matrix a magic matrix? d. Create a 10 x 10 matrix out of the following components (see arrangement to 2* a the right): a^2 a +2] . The matrix a o 2 times the matrix a A matrix formed by squaring each element of a o 2 plus the matrix a Is your result a magic matrix? e. Exchange the top left corner and bottom right corner elements of the matrix a and store the resulting matrix in b. (Your solution should also work for any other square matrix a, not just the 5x5 square matrix) f. Create a 10x10 matrix e with zeros in the leading diagonal (top left to bottom right) and ones everywhere else. Do this efficiently, so that if you had to create a 100x100 matrix instead, you would not have to change your code much
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
