1234567891011 |
- function [data, baseline_value] = correct_baseline(data,goodtrials,t,baselinewin)
- % simple baseline correction function. inputs:
- % - data (time x trials)
- % - array of booleans describing which trials are good
- % - timescale
- % - [start end] baseline window in same unit as timescale
- bl = find(t>baselinewin(1) & t<baselinewin(2));
- baseline_value = mean(mean(data(bl,goodtrials==1)));
- data = data - baseline_value;
- end
|