How do I replace (or remove) <undefined> with NaN in a categorical array ?
34 ビュー (過去 30 日間)
古いコメントを表示
How do I replace (or remove) <undefined> with NaN in a categorical array ? .dat file excerpt is attached. Thanks for any help !
0 件のコメント
採用された回答
Cris LaPierre
2022 年 12 月 8 日
<undefined> is the value used for a missing categorical entry. NaN is for missing numerical values.
You can replace missing values using fillmissing
3 件のコメント
Cris LaPierre
2022 年 12 月 8 日
編集済み: Cris LaPierre
2022 年 12 月 8 日
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")
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Categorical Arrays についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!