Back to the main page.

Bug 892 - ft_freqstatistics should give meaningful error in case default cfg.parameter is not available

Status CLOSED FIXED
Reported 2011-08-24 14:31:00 +0200
Modified 2011-08-31 14:49:58 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Laura Marzetti - 2011-08-24 14:31:00 +0200

at this moment the error mentions that all inputs should have powspctrm, because that is the default for cfg.parameter. However, I did not specify a default, so it is unclear why powspctrm is recommended. Better is if ~isfield(cfg.parameter) && isfield(input, 'powspctrm') set default to powspctrm else give error that cfg.parameter should be specified end note that the same check on the default can be considered for all other functions that have cfg.parameter


Jan-Mathijs Schoffelen - 2011-08-29 15:48:38 +0200

OK, I added this for this function. We may discuss whether we should take away the clever assignment of the default, and just call ft_checkconfig(cfg, 'required', 'parameter') to let the user think twice about it.