Replacing all 999 by zeros
Show older comments
I have an array X of size 5000x10 with some missing values. Missing values are represented by '999'. I tried following two ways to replace all '999' by zeros. The first way works correctly but second way replaces all the elements of some rows by zeros.
way1: X(find(X==999))=0; [ Works correctly ]
way2: [a,b]=find(x==999.0); x(a,b)=0; [ replaces all the elements of some rows by zeros ]
What is difference between two. Thanks for your answers
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!