Create a matrix 4x4 of integer random numbers between 1 and 50, and perform the following operations: a. Generate a (1x3) matrix of the original b. Generate a (4x2) matrix of the original with the row order reversed c. Replace the second column of the matrix with [4; 8 ; 16; -2] ( MATLAB)
Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate
the question. Thank You So Much.
clc
clear
%generate random matrix
randMatrix = randi(50,4)
%generate one*three
oneCrossThree = randMatrix(1,1:3)
%generate one*three
fourCrossTwo=randMatrix(4:-1:1,1:2)
randMatrix(1:4,2) = [4; 8 ; 16; -2];
randMatrix
Get Answers For Free
Most questions answered within 1 hours.