Borrar filtros
Borrar filtros

How to solve this simple index problem

1 visualización (últimos 30 días)
Rita
Rita el 30 de Ag. de 2015
Comentada: Rita el 30 de Ag. de 2015
Hi, I have
a=[1;2;3]and b=[23;nan;4]
how I can get these
c=[2] and also D=[1,23;3,4]
Thanks a lot

Respuesta aceptada

Walter Roberson
Walter Roberson el 30 de Ag. de 2015
idx = isnan(b);
c = a(idx);
D = [a(~idx), b(~idx)];

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by