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
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.
Step by Step Solution
3.31 Rating (148 Votes )
There are 3 Steps involved in it
Step: 1
Heres an implementation of the RoundZero function in Python import numpy as ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Elementary Statistics
Authors: Robert R. Johnson, Patricia J. Kuby
11th Edition
978-053873350, 9781133169321, 538733500, 1133169325, 978-0538733502
Students also viewed these Mathematics questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App