Conversation
| @@ -0,0 +1,147 @@ | |||
| function [sts, ep_exp] = pspm_expand_epochs(epoches, expansion, options) | |||
There was a problem hiding this comment.
I would suggest using the varargin syntax.
| % Initialize status | ||
| sts = -1; | ||
|
|
||
| % Check if epochs matrix and expansion vector are valid |
There was a problem hiding this comment.
Since this is needed for all modes of the function, I would check it in the beginning of the main function, before anything is loaded from file (faster and easier to read).
|
|
||
| % | ||
| % Ensure that the start of any epoch is not negative | ||
| expanded_epochs_temp(expanded_epochs_temp(:,1) < 0, 1) = 0; % or <1??? |
There was a problem hiding this comment.
Probably we should put this code into pspm_get_epochs (if the functionality does not exist there already), because it is needed in several functions.
then just call [sts, epochs] = pspm_get_timing('epochs', epochs)
| % * timeunits: timeunits of the epochfile. | ||
| % ┌───options | ||
| % └─.channel_action: | ||
| % └─.channel_action: [pre, post] |
There was a problem hiding this comment.
why is the channel action changed?
dominikbach
left a comment
There was a problem hiding this comment.
some functions return sts == -1 if unsuccessful, others sts == 0. So to be most general, it is best practice to check for unsuccessful downstream functions with if sts < 1
Fixes #758 .
Changes proposed in this pull request: