Skip to content

Commit

Permalink
Minor improvement in weights size check.
Browse files Browse the repository at this point in the history
  • Loading branch information
pablorcum committed Sep 9, 2024
1 parent a73999b commit 95db0a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions toolbox/src/bossdevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ function stop(obj)
end

function set.spatial_filter_weights(obj, weights)
% check that the dimensions matches the number of channels
assert(size(weights, 1) == obj.num_eeg_channels,...
'Number of rows in weights vector (%i) must equal to number of EEG channels (%i).',size(weights, 1),obj.num_eeg_channels);
num_rows = size(obj.spatial_filter_weights, 1);
num_columns = size(obj.spatial_filter_weights, 2);
% check if the number of columns does not exceed the number of parallell signals
% check that the dimensions matches the number of channels
assert(size(weights, 1) <= num_rows,...
'Number of rows in weights vector (%i) cannot exceed number of maximum supported EEG channels (%i).',size(weights, 1),num_rows);
% check if the number of columns does not exceed the number of parallel signals
assert(size(weights, 2) <= num_columns,...
'Number of columns in weights vector (%i) cannot exceed number of signal dimensions (%i).',size(weights, 2),num_columns);
% add additional columns if necessary
Expand Down

0 comments on commit 95db0a5

Please sign in to comment.