How do i extract only prime numbers from a matrix
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vc27
el 18 de Nov. de 2022
Comentada: Vc27
el 18 de Nov. de 2022
I have a row vector with 100 variables and i want to extract all the prime numbers in this, is there a simple way to do this? thanks in advance
0 comentarios
Respuesta aceptada
Stephen23
el 18 de Nov. de 2022
V = randi(1000,1,100) % fake data
P = V(isprime(V)) % the prime values
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrices and Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!