While all elements are not equal to NaN
66 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
evangeline
el 1 de Mzo. de 2018
Respondida: evangeline
el 2 de Mzo. de 2018
I have an array and I turn one element to NaN in each iteration until all elements are NaN, like:
While (all elements in array are not NaN)
do aomething
End
How can I do this?
0 comentarios
Respuesta aceptada
Jos (10584)
el 1 de Mzo. de 2018
not (~), all, and isnan are your friends. If A is your array,
while ~all(isnan(A(:)))
...
end
2 comentarios
Más respuestas (1)
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!