Fill missing cells NANs

3 次查看(过去 30 天)
Sarah Yun
Sarah Yun 2019-12-28
Hi,
I imported data from textfile using data editor.
Some cells are <missing data>
This is string data.
All cells must be numerical or NAN
How can I fill the missing data cells with NAN?

回答(1 个)

Cris LaPierre
Cris LaPierre 2020-1-31
<missing> is the appropriate value for missing string data. From the doc:
Standard missing values depend on the data type:
  • NaN for double, single, duration, and calendarDuration
  • NaT for datetime
  • <missing> for string
  • <undefined> for categorical
  • ' ' for char
  • {''} for cell of character arrays
If you need NaN, read in your data as numbers instead of strings.

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by