Prime number or its nearest prime numbers
Show older comments
anyone please tell me in matlab how to write a function to find prime number of any number if it is not prime number then function show its nearest prime numbers... let take example ...take number 9 we know it is not prime then the program will show its nearest prime like 7 and 11..
Accepted Answer
More Answers (1)
Sean de Wolski
on 13 Apr 2012
0 votes
isprime() will be your friend.
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!