From 95db0a5f6c7b92699ba617c12e8d7b38dedffc95 Mon Sep 17 00:00:00 2001 From: Pablo Romero Date: Mon, 9 Sep 2024 17:49:16 +0200 Subject: [PATCH] Minor improvement in weights size check. --- toolbox/src/bossdevice.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolbox/src/bossdevice.m b/toolbox/src/bossdevice.m index cf8f614..d4ed859 100644 --- a/toolbox/src/bossdevice.m +++ b/toolbox/src/bossdevice.m @@ -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