Find and replace a specific value in a table
이전 댓글 표시
Hello, I have a table with over 15000 rows and 100 columns. I want to plot the values in columns but I need to turn some of them that are set to -9999 to NaN. And there are -9999 in all my columns( my columns are named)/
I would like to use something like that :
table(table==-9999)=NaN
But I know that I can't use comparator with a whole table so I have to add index :
table(table(:,:)==-9999)=NaN
But it's still not working.
Is there an index that take all columns? Or maybe another solution more simple?
Thank you!
채택된 답변
추가 답변 (2개)
t = table([1;-9999;3],[-9999;NaN;4],[NaN;4;5])
t = standardizeMissing(t,-9999)
David Hill
2022년 4월 21일
m=table2array(yourTable);%assuming your table is all numbers of the same type
m(m==-9999)=nan;
%then just plot from the matrix
카테고리
도움말 센터 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!