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!