Question: Simple Matlab functions 7) Write a function extract odds that takes an array of random integers (you can generate this with the Matlab command v

Simple Matlab functions
7) Write a function extract odds that takes an array of random integers (you can generate this with the Matlab command v = randi(0501100, 1)):) and returns only the elements of the array that are even, using an if...else statement. 8) Write a function extract_odds_or_evens that takes two inputs: an array of random integers like in (7) and a second parameter that is either the string 'odd' or 'even'. Use combinations of a for loop and up to two if...else statements to extract either the odd or even numbers based on the second parameter and return the result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
