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 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
Get step-by-step solutions from verified subject matter experts
