Posts

Given a vector x = [3, 1, 4] and integer number n = 5, create matrix y containing n-times x(1) in 1st Row , n-times x(2) in 2nd Row and so on….then covert this matrix into row vector V.

Make an n × n random matrix a) calculates its inverse b) Multiply the two back together c) calculates the residual (difference from the desired n × n identity matrix eye(n))

Given matrix A = [0, 2, 1; 3, 1, 0; 4, 6, 4; 2, 0, 2], create a matrix with 1’s at locations where a has zeros and 0’s elsewhere. Create a matrix containing all 0’s except the maximum elements in each row of ‘A’.

Given the same matrix m = [1 2 3; 2 1 5; 4 6 4; 2 3 2], create matrix n with rows sorted in a descending order of elements in the second column.

Create vector “s “containing elements of ‘x’ sorted in an ascending order. Clear x from the workspace. From s create back a vector with the same elements and in the same order as in x.

Create a matrix of 3 by 3 with all ones, then Create matrix of 8 by 1 with all zeros, finally Create a matrix of 5 by 2 with all elements equal to 0.37.

Prove that if a and b are two positive numbers then 𝐻.𝑀≤𝐺.𝑀≤𝐴.𝑀