Here's a fix to the problem in #2 . I putting 0's next to channels I didn't want to include in the CHANACTIVE excel file. It turns out formatWindows.m just leaves those channels as all NaNs, and then they get caught in averageAreas because too many timepoints are NaNs. I think the NaNs checked here are intended to be the NaNs introduced when detecting saturation, but they also catch the CHANACTIVE NaNs by mistake.
One option to fix this would be to change the behavior of formatWindows.m so it doesn't save any data for the non-active channels. Instead I added a new field to dataOpts called toRemove, a string array of all the channels to be removed. I think this requires fewer changes to the code and I don't know what else relies on the NaNs introduced by non-active channels in formatWindows.m, so this extra field in dataOpts could be redundant with CHANACTIVE.
Here's a fix to the problem in #2 . I putting 0's next to channels I didn't want to include in the
CHANACTIVE
excel file. It turns outformatWindows.m
just leaves those channels as all NaNs, and then they get caught inaverageAreas
because too many timepoints are NaNs. I think the NaNs checked here are intended to be the NaNs introduced when detecting saturation, but they also catch theCHANACTIVE
NaNs by mistake.One option to fix this would be to change the behavior of
formatWindows.m
so it doesn't save any data for the non-active channels. Instead I added a new field todataOpts
calledtoRemove
, a string array of all the channels to be removed. I think this requires fewer changes to the code and I don't know what else relies on the NaNs introduced by non-active channels informatWindows.m
, so this extra field indataOpts
could be redundant withCHANACTIVE
.@mhunterklein , could you review this?