How to replace a string with another string in a Matlab table
13 次查看(过去 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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!