How do I replace (or remove) <undefined> with NaN in a categorical array ?
32 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Douglas Leaffer
el 8 de Dic. de 2022
Comentada: Douglas Leaffer
el 9 de Dic. de 2022
How do I replace (or remove) <undefined> with NaN in a categorical array ? .dat file excerpt is attached. Thanks for any help !
0 comentarios
Respuesta aceptada
Cris LaPierre
el 8 de Dic. de 2022
<undefined> is the value used for a missing categorical entry. NaN is for missing numerical values.
You can replace missing values using fillmissing
3 comentarios
Cris LaPierre
el 8 de Dic. de 2022
Editada: Cris LaPierre
el 8 de Dic. de 2022
Your table variable source is of type categorical, so you must use a valid categorical data type, which is categorial, char array, or string.
- categorical(0)
- "0"
- "None"
Here is an example that uses "None"
load Table4excerpt.mat
T41.source = fillmissing(T41.source,'constant',"None")
Más respuestas (0)
Ver también
Categorías
Más información sobre Categorical Arrays en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!