remove NaN from 1xn Matrix

1 visualización (últimos 30 días)
Takim Mustakim
Takim Mustakim el 10 de Nov. de 2022
Editada: Arif Hoq el 10 de Nov. de 2022
A = [0 3 2 4 1 NaN 3 2 NaN 2 4 2 1 3 NaN 2 4 2];
How to make matrix B from A but without "NaN" like:
B = [0 3 2 4 1 3 2 2 4 2 1 3 2 4 2]; from A

Respuesta aceptada

Arif Hoq
Arif Hoq el 10 de Nov. de 2022
Editada: Arif Hoq el 10 de Nov. de 2022
A = [0 3 2 4 1 NaN 3 2 NaN 2 4 2 1 3 NaN 2 4 2];
B = A(~isnan(A))
B = 1×15
0 3 2 4 1 3 2 2 4 2 1 3 2 4 2

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by