Question: Twin primes are primes numbers whose difference is 2. Create a matlab function called twinp.m that takes n [integer] as an input, and generates an

 Twin primes are primes numbers whose difference is 2. Create a

Twin primes are primes numbers whose difference is 2. Create a matlab function called twinp.m that takes n [integer] as an input, and generates an n times 2 matrix y, of n number of twin prime sets. For example: y = twinp (3) y = [3 5 5 7 11 13]: You are allowed to use the isprime() function to check for a prime. Use a while loop to solve this problem. Solution function y = twinp (n) y = n: end

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!