Question: Mini - Project 3 Write a function called FindPrimes that takes 2 scalars, lowerRange and upperRange, and produces 2 output arrays called outOdds and outPrimes.

Mini-Project 3
Write a function called FindPrimes that takes 2 scalars, lowerRange and upperRange, and produces 2 output arrays called outOdds and outPrimes.
Step 1: The function first finds all the odd numbers within the range defined by lowerRange and upperRange, limits inclusive. The output outOdds is a 1D array with all the odd
numbers, except integer multiples of 5, within the specified range.
Step 2: outPrimes contains all prime numbers above the lowerRange in ascending order while the sum of the outPrimes is less than the highest element of outOdds.
The input arguments (lowerRange, upperRange) are two (numeric) scalars.
The output argument (outOdds) and (outPrime) are 1xm(numeric) arrays.
Hint: Use isprime to check if a numer is prime.
For example: For the given inputs:
lowerRange =2;
upperRange =20;
On calling FindPrimes:
[outOdds, outPrimes]= FindPrimes ( lowerRange, upperRange)
produces,
Function o.
 Mini-Project 3 Write a function called FindPrimes that takes 2 scalars,

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!