Fill missing cells NANs

5 visualizaciones (últimos 30 días)
Sarah Yun
Sarah Yun el 28 de Dic. de 2019
Respondida: Cris LaPierre el 31 de En. de 2020
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?

Respuestas (1)

Cris LaPierre
Cris LaPierre el 31 de En. de 2020
<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.

Categorías

Más información sobre String Parsing 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