Question: Q 5 ( 4 0 % ) Write a function ( call it matrix _ fun ) that performs the following tasks: Takes a matrix
Q
Write a function call it "matrixfun" that performs the following tasks:
Takes a matrix as input argument the matrix can be of any dimensions, eg
etc.
Using a combination of looping and selection statements, calculates the square root of all nonnegative elements and the absolute value of all negative elements in the matrix.
Writes the new matrix with changed values from Step to a dat file Hint: use ascii qualifier
Returns the new matrix as output argument.
Examples of calling matrixfun:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
