How to detect and remove outliers in excel data using matlab

Hi
I am working on validation of direct normal irradiance (DNI) data. i have ground data for 2 years and I want to detect and remove outliers from the data (values beyond three standard deviations around the mean). data is in excel and is at ten minutes interval. Moreover, data in excel has various columns and I am only concerned with time column and DNI (4 column in screenshot). I need to know how can i do this using matlab. Any help will be highly appreciated. screenshot of data in excel is attached.

Answers (1)

I'd try something like this
clear, clc
T = readtable('excelfilename.xlsx');
time = T.time(T.dni > mean(T.dni)-3*std(T.dni) & T.dni < mean(T.dni)+3*std(T.dni));
DNI = T.dni(T.dni > mean(T.dni)-3*std(T.dni) & T.dni < mean(T.dni)+3*std(T.dni));

Products

Release

R2018a

Asked:

on 3 Mar 2022

Answered:

on 3 Mar 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!