Set Prime vales equal to zero

Given matrix
x=[10 12 36 78 92;11 14 57 74 91;40 38 29 72 81;34 27 39 48 62;10 14 18 82 73]
, how can I create a new matrix "xnp" that sets all non-prime elements equal to 0?

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 31 de En. de 2019

0 votos

isprime()

La pregunta está cerrada.

Etiquetas

Preguntada:

el 31 de En. de 2019

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by