Question: 2. Create a function myPrimes that returns the first n primes as a vector, given a positive integer. For example, if the positive integer is

2. Create a function myPrimes that returns the first n primes as a vector, given a positive integer. For example, if the positive integer is 5, the vector returned would include 1, 2, 3, 5, 7. In your script, prompt the user for the positive integer value. DO NOT use built-in Matlab function primes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
