Question: MATLAB: Write a function called odd_number that takes a matrix A of positive integers as its sole input. If the assumption is wrong, the function

MATLAB: Write a function called odd_number that takes a matrix A of positive integers as its sole input. If the assumption is wrong, the function returns an empty matrix. Otherwise, the function doubles every odd element of A and returns the resulting matrix. Notice that the output matrix will have all even elements. For example, the call B = odd_number([1 4; 5 2; 3 1], will make B equal to [2 4; 10 2; 6 2]

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!