Let's take some sample data.
x = randi([-10 10], 1, 10);
Change three locations to -999. I also want to make a copy of x to keep around so I can show two techniques and have the original data for comparison.
x(randperm(10, 3)) = -999
You could use logical indexing.
You could also use standardizeMissing.
y = standardizeMissing(xcopy, -999)
Now compare the original data and the two modified copies.