how can i write a script file to find all prime numbers from a given range of numbers?
Mostrar comentarios más antiguos
I need to find all prime numbers from 0-n (user input n) and n can be anything from 0 to 100. I want to do this for a range from 0-24, so I want matlab to display all prime numbers from 0-24. I don't know where to start though.
Respuestas (1)
the cyclist
el 11 de Sept. de 2015
Editada: the cyclist
el 11 de Sept. de 2015
N = 100;
primes(N)
Categorías
Más información sobre Elementary Math en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!