How to print the first 100 primes including 1 as a vector
Ältere Kommentare anzeigen
i need to print vectors containing all prime numbers less than 100, including 1 as 1 is usually not shown as a prime number in matlab. Thanks
Akzeptierte Antwort
Weitere Antworten (1)
Udit Gupta
am 29 Mai 2014
To print prime numbers less than 100 use
primeNums = [1 primes(100)]
To print first 100 frime numbers use
primeNums = [1 primes(523)]
Kategorien
Mehr zu Numerical Integration and Differential Equations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!