Question: Fix the code % FIX ME To Make It run correctly. Use the Programming Language ---- > MATLAB Finding outliers in a data set. Detecting
Fix the code % FIX ME
To Make It run correctly.
Use the Programming Language ---- > MATLAB
Finding outliers in a data set.
Detecting unusual numbers or outliers in a data set is important in many disciplines, because the outliers identify interesting phenomena, extreme events, or invalid experimental results. A simple method to check if a data value is an outlier is to see if the value is a significant number of standard deviations away from the mean of the data set. For example,
is an outlier if
where is the data set mean, is the data set standard deviation, and
is the number of standard deviations deemed significant.
Assign outlierData with all values in userData that are numberStdDevs standard deviations from userData's mean. Hint: use logical indexing to return the outlier data values.
Ex: If userData is [9, 50, 51, 49, 100 ] and numberStdDevs is 1, then outlierData is [9, 100].


Save CReset MATLAB Documentation Your Function 1 function outlierDatagetoutliers (userData, numberStdDevs) 2 % getOutliers: Return all elements of input array data that are more than 3 % numStdDevs standard deviations away from the mean. 5 % Inputs: userData - array of input data values numberStdDevs- threshold number of standard deviations to determine whether a particular data value is an outlier 9 % Outputs : outlierData - array of outlier data values 10 % Assign dataMean with the mean of userData dataMean = 0; 12 13 14 15 16 17 18 19 20 21 end % Assign dataStdDev with userData's standard deviation dataStdDev-0; % Assign outlierData with Return outliers outlierData = 0; C Reset Code to call your function 1 getoutliers ([9, 50, 51, 49, 100], 1) Run Function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
