This is a set of simple matrix manipulations. % a. Create a five by six matrix,
ID: 642585 • Letter: T
Question
This is a set of simple matrix manipulations.
% a. Create a five by six matrix, A,
that contains random numbers between
% 0 and 10.
% b. Create a six by five matrix, B,
that contains random numbers between
% 0 and 10.
% c. Find the inverse of matrix A*B and store it in the %variable, C.
% d. Without iteration, create a new matrix D that is the same
% as A except that all values less than 5 are replaced by zero.
% e. Using iteration, create a new matrix F that is the same as % A except that all values less than 5 are replaced by zero.
% f. Create a new matrix G that is the matrix A with the columns reversed.
% For example:
% if A is [1 2 3; 3 2 5; 1 7 4], G should be
% [3 2 1; 5 2 3; 4 7 1]
% g. Find the minimum value amongst all the elements in A and %store your answer in the variable H.
USE MATLAB TO WRITE THE SCRIPT
Explanation / Answer
import numpy as x
import numpy as y
import numpy as np
from numpy.linalg import inv
A= x.random.randint0,10, size=(5,6))
B= y.random.randint(0,10, size=(5,6))
print np.fliplr(A)
print(A.min())
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.