Skip to content

Commit

Permalink
ENH - use mad() function from stats toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoostenveld committed Feb 14, 2024
1 parent 6cebb4b commit 7ba0239
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions private/artifact_level.m
Expand Up @@ -82,8 +82,7 @@
case 'maxzvalue'
level = nanmax((dat-repmat(mval, 1, nsample))./repmat(sd, 1, nsample), [], 2);
case 'mad'
mval = median(dat, 2, 'omitmissing'); % the median per channel, over time
level = median(abs(dat-repmat(mval, 1, nsample)), 2, 'omitmissing'); % median absolute deviation
level = mad(dat, 1, 2);

case 'neighbexpvar'
% this results in a Nx1 vector
Expand Down

0 comments on commit 7ba0239

Please sign in to comment.