Removing NAN values from the table and deleting it.
91 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Shelender Kumar
el 17 de Nov. de 2018
Hi
I have a table which is arrranged in susch a waym that it has one row of data and other row which contain NAN and so on, I want to get rid of NAN and aferwards deleting it.
Could you help me with this.
0 comentarios
Respuesta aceptada
madhan ravi
el 17 de Nov. de 2018
Editada: madhan ravi
el 17 de Nov. de 2018
rmmissing(T) %deletes row containing nan where T your table
16 comentarios
madhan ravi
el 19 de Nov. de 2018
Thank you sir Walter , have to familiarise with any and all it‘s slightly confusing :)
Más respuestas (2)
Francesco
el 12 de Feb. de 2025 a las 13:56
Editada: Francesco
el 12 de Feb. de 2025 a las 13:56
Following another question I found this code working really good:
Xnew=X((isfinite(X)));
The new array has no Nan inside.
5 comentarios
Francesco
el 12 de Feb. de 2025 a las 19:10
Editada: Francesco
el 12 de Feb. de 2025 a las 19:12
Yes the principle is the same, if you have a table, for example in your case, you can call the columns using T.Column_name, in this case:
T = array2table([1,2,3;nan,2,3;1,2,3;1,2,3;nan,2,3])
X=T.Var1 ; Y=T.Var2; Z=T.Var3;
Xnew=X((isfinite(X)));
Ynew=Y((isfinite(X)));
Znew=Z((isfinite(X)));
T_new = array2table([Xnew,Ynew,Znew])
Ver también
Categorías
Más información sobre Tables 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!