I have to do the rmoutliers function for an assignment without using the rmoutliers function. I believe I need to use a while loop, but I am still unfamiliar with the syntax
Essentially for the while loop I want is to check each value in a vector and check to see if it is outside the threshold and an outlier, return the index and replace the value with 
The threshold is based off of the mean +- 3*std of the vector just like the rmoutliers function
This is the exact function I am trying to replicate:
[B,TF] = rmoutliers(___) also returns a logical vector corresponding to the rows or columns of A that were removed.