Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please solve using MATLAB Provide MATLAB commands which perform the following op

ID: 2249614 • Letter: P

Question

Please solve using MATLAB

Provide MATLAB commands which perform the following operations for the given matrix A. 15 33 37 32 44 28- 24 25 60 22 21 65 A 49 26 427760 30 76 25 73 28 28 54 72 24 15 70 11 38 a. Convert the matrix A to a 6 by 5 matrix. Assign the new matrix into a variable called B. b. Sort matrix A according to the third column in ascending order. c. Sort matrix A according to the fourth column in descending order. d. Compute mean of each row. e. Assign the blue colored elements of matrix A into a new variable called C f. Assign the first column of matrix A into a vector called VA and last row into a vector HA. g. Remove last column of the matrix A and extract the diagonal elements of the new matrix A. h. Compute the mean and variance of all elements in matrix A. i. Compute the mean andv j. Compute the mean and variance of each row of matrix A.

Explanation / Answer

paste this code

clc
close all
A=[15 3 37 32 44 28
24 25 60 22 21 65
49 26 42 77 60 30
76 25 73 28 28 54
72 24 15 70 11 38];
% a
B=reshape(A,6,5)

% b
sortrows(A,3)

%c (this is not working in my version).It has to work
% sortrows(A,4,'descend')

%d
% mean
mean(A(1,:))
mean(A(2,:))
mean(A(3,:))
mean(A(4,:))
mean(A(5,:))

%e
c=[A(1,3) A(1,5) A(1,6)
A(3,3) A(3,5) A(3,6)
A(4,3) A(4,5) A(4,6)]
% f
VA=A(:,1)
HA=A(5,:)

% g

new = A(:,1:end-1)
diag(new)

% h
mean2(A)
std2(A)
% i
mean(A)
std(A)
% j

m1=mean(A(1,:))
m2=mean(A(2,:))
m3=mean(A(3,:))
m4=mean(A(4,:))
m5=mean(A(5,:))

s1=std(A(1,:))
s2=std(A(2,:))
s3=std(A(3,:))
s4=std(A(4,:))
s5=std(A(5,:))