How to replace a string with another string in a Matlab table
17 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a table that has 'N/A' in some of the column cells. I want to replace 'N/A' by ''. Would anyone tell me how to do that?
Thanks,
Jennifer
0 件のコメント
採用された回答
Walter Roberson
2015 年 8 月 28 日
Example:
t.Var1(strcmp(t.Var1,'N/A')) = {''};
6 件のコメント
Stephen23
2023 年 1 月 7 日
編集済み: Stephen23
2023 年 1 月 7 日
"Please provide some code/hint to remove it"
Rather than removing them, the best approach is to avoid them in the first place (hint: as Walter Roberson already wrote, you can use the READTABLE options, e.g. TreatAsMissing). If you clicked the paperclip button to upload a sample data file then someone could probably help you with that.
Ashishkumar Gupta
2023 年 1 月 7 日
Thanks @Stephen23, Treatasmissing worked....I did not know the exactword to write in readtable(), that's y could not understand @Walter Roberson.
Now it worked!!
その他の回答 (1 件)
Image Analyst
2015 年 8 月 27 日
Look at the isnan() function and I'm sure you'll find the way.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!