Closed dbirman closed 9 years ago
Should be able to do that by changing the code around Line 141 to:
if isStaircase(type) oldS = type; restartArgs = getRestartArgs(oldS,1); args = {restartArgs{:} args{:}}; type = oldS(end).type; else
Can you try that and make sure that it works (I don't have sample data structures and stuff to test this easily). getArgs may give you a warning that it is setting the arguments 2 times (we can suppress that later if this works as expected).
Tested, seems to be functional. Both initStaircase and initUpDownStaircase generated warnings.
(initStaircase) Warning: Variable 'initialStepsize' has been set 2 times
(initStaircase) Warning: Variable 'initialThreshold' has been set 2 times
(initUpDownStaircase) Warning: Variable 'initialStepsize' has been set 2 times
(initUpDownStaircase) Warning: Variable 'initialThreshold' has been set 2 times
Cool. I think then you just need to set the flag for getArgs not to complain about multiple settings (in the getArgs call that follows these lines)
suppressMultipleSettingMessage=0
You can't override the init arguments when calling doStaircase('init',s,...). It would be great to be able to do
doStaircase('init', s, 'initialThreshold', x);
and have it override the calculated threshold or whatever other arguments you want to include.I'm working around this issue by calling:
[args, vals, ~] = getArgs(s(1).initArgs); s(end+1) = doStaircase('init','updown',args{1},vals{1},args{2},vals{2});
instead of usingdoStaircase('init',s, ...);
But obviously that's a mess and only works because I happen to know the number of initArgs I was using originally. If there's a better way to do this, or if the functionality exists and I just don't understand it let me know.