MATLAB: How can I generate random data with percent of outliers in matlab

g++

I work in multivariate data and I want to do simulation study and use 2 robust estimators so I want to generate random data with outliers how can I do that

Best Answer

If you want normally-distributed data, use the randn function. To create outliers, create a separate matrix with a larger standard deviation.