Question: 4.1 Write a function called checkmat evenodd that will receive a matrix (for example, mat) as an input argument, and return a new matrix (same

 4.1 Write a function called "checkmat evenodd that will receive a

4.1 Write a function called "checkmat evenodd that will receive a matrix (for example, mat) as an input argument, and return a new matrix (same size with the input matrix) using nested for loops. If the element in the input matrix is an even number, then the corresponding element in the new matrix is 0; otherwise, the element in the new matrix is 1. Also, write the block comment "This function check the even/odd number of a matrix." See below example: outmat 1 -2 34 5 6 7 8 9 -10 -12 4.2 Generate a random 3-by-5 integer matrix called "mat code, for example: [ out mat ] = checkmat-even-odd( mat) in the range [-10, 10], and test your

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!