Producing 100 prime number in a vector
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abhishek
am 27 Okt. 2022
Beantwortet: David Hill
am 27 Okt. 2022
Hi,
I want to generate a vector in which I could check that vector for prime numbers using isprime(vector). So far I have been able to get the get a vector, but it does not give the number which are prime. Instead it gives out a vector where all the prime numbers are replaced by one and non prime with zero.
p=(2:1:600)
y=isprime(p)
I used the following code.
Thanks in advance
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Discrete Math finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!