Question: Please help me with this MATLAB problem! 3) 2 pts) Create an m-file called p4 12magic.m and solve the following inside it: 4.12 amed a
3) 2 pts) Create an m-file called p4 12magic.m and solve the following inside it: 4.12 amed a Create a 5 x 5 magic matrix n (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) Createa 10 X 10 matrix out of the following components (see Figure P4.12) . The matrix a . 2 times the matrix a A matrix formed by squaring each element of a . 2 plus the matrix a Is your result a magic matrix? Does the order in which you arrange the com- ponents a ffect your answer? For each part, to test for magic matrix, sum the rows, sum the columns and the main and cross main diagonals using matlab matrix commands. After running your script, copy the results from the command line and paste it at the bottom of your script and comment them out a+2 Figure P4.12 Create a matrix out of other matrices
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
