Question: Please show me how the code is written. So far i have : %writing function z=magic(5); %New values for z z(:,2)=z(:,2)/sqrt(3); z(5,:)=z(5,:)+z(3,:); z(:,1)=z(:,1).*z(:,4); %Set diagonal

Please show me how the code is written.
So far i have :
%writing function
z=magic(5);
%New values for z
z(:,2)=z(:,2)/sqrt(3);
z(5,:)=z(5,:)+z(3,:);
z(:,1)=z(:,1).*z(:,4);
%Set diagonal elements equal to 2
z(1:5+1:5*5)=2;
%If the results obtained in a is denoted q, then display the diagonal of qq'
%Display the square of each elemnt of q
%Display the maximum and minimum values of the elements in c
Do these problems in a MATLAB notebook. Print and submit the notebook. Or use a script and publish it. 1. Letz-magic(5) a. Perform the following operations to z in the order given: i. Divide column 2 by v3 ii. Add the elements of the third row to the elements in the fifth row (the third row remains unchanged) iii. Multiply the elements of the first column by the corresponding elements of the fourth column, and place the result in the first column iv. Set the diagonal elements to 2 b. If the result obtain in a is denoted q, then display the diagonal of quq c. Display the square of each element of q d. Display the maximum and minimum values of the elements in c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
