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

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

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!