Need Help ?

Home / Expert Answers / Other / need-help-part-c-code-has-already-been-provided-to-define-a-variable-a-that-is-a-random-mxn-matrix-w

(Answered): need help part C Code has already been provided to define a variable A that is a random MXN matrix w ...



Code has already been provided to define a variable A that is a random MXN matrix with a random number of rows and columns. Tneed help part C

Code has already been provided to define a variable A that is a random MXN matrix with a random number of rows and columns. The element values of the matrix are random integers that fall in the range from –10 to 10. The matrix has between 5 and 10 rows and between 5 and 10 columns. Add commands to perform the operations described below and assign the results to the indicated variable names. Replace all elements in A that have a value less than 0 with the number 999 and assign the resulting matrix to B. Replace all positive elements in A with their square root and assign the resulting matrix to C. • Find all elements in A with values between –2 and 2 and assign these to a new matrix, D. Use array addressing to solve these problems. Solve this problem using only vectorized code with no loops or conditional statements. You will lose points if you use these. Do not overwrite the A matrix in your code. Script © C Reset MATLAB Documenta = 1 A randi([-10,10], randi([5,10]), randi([5,10])); 2 B=A 3 B(B<0)=999 4 C 5 D=A 6 D(-2<D & D<2) 7


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer to Code has already been provided to define a variable A that is a random MXN matrix with a random number of rows and colum...
We have an Answer from Expert

Buy This Answer $4

Place Order