Is there any particular reason why "1" should be a prime number? Since none of exampe in test suite pointing us to that direction. besides, I fail to figure out the necessity of that either.
Mathematically speaking, 1 is not a prime number. Primes are defined as number greater than 1. Also, the difference between 2 and 1 isn't two, so I don't see why [1 2] would be a valid output anyway.
James and bainhome, I apologise for making the two errors that you pointed out. I have corrected them and updated the problem.
Vector of numbers divisible by 3
Sum of odd numbers in a matrix
Matlab Basics II - Intervals
Find the treasures in MATLAB Central and discover how the community can help you!
Select a Web
Choose a web site to get translated content where available and see local events and
offers. Based on
your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country
sites are not optimized for visits from your location.
Contact your local office