Removing NaNs from imported table

178 次查看(过去 30 天)
Hey everyone,
I am trying to remove all the NaNs from an imported table with readtable() (.xlsx file).
i've tried using isnan() but without success.
assuming all i have right now is:
R = readtable('blabla')
how can i remove the NaNs and keep the save the new table?
  • table looks like this:
thanks for the help!

采纳的回答

Star Strider
Star Strider 2023-1-14
See if the rmmissing function (introduced in R2016b) will do what you want.
  4 个评论
Ilay Green
Ilay Green 2023-1-14
tyvm!
made me realize it is not neccesary to use a certain function when facing a problem!

请先登录,再进行评论。

更多回答(1 个)

Jeff Beck
Jeff Beck 2023-1-14
编辑:Jeff Beck 2023-1-14
You might try using the "MissingRule" option set to "omitrow" in readtable:
R = readtable('blabla', 'MissingRule', 'omitrow');
  1 个评论
Ilay Green
Ilay Green 2023-1-14
thanks for reply!
its not working though, Star Strider solution worked well for me

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by