Write a function called RoundZero() that iterates through each value in a matrix and rounds positive numbers
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function called "RoundZero()" that iterates through each value in a matrix and rounds positive numbers to the nearest integer, and sets negative numbers equal to zero.
Your function takes a single input variable:
- M - a matrix of floating point double numbers.
Your function has three outputs:
- Mout - the matrix with rounded and zeroed values
- nr - the number of positive elements rounded.
- n0 - the number of negative elements set to zero, or originally zero.
Related Book For
Posted Date: