From 5430fa9615661a36b839e19642175e494ce5538c Mon Sep 17 00:00:00 2001 From: Michael-Sun Date: Fri, 9 Feb 2024 14:32:53 -0500 Subject: [PATCH] Update to create_design_single_event to allow variable length designs for convenient study simulation --- .../Model_building_tools/create_design_single_event.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CanlabCore/Model_building_tools/create_design_single_event.m b/CanlabCore/Model_building_tools/create_design_single_event.m index a7102918..3e5d1bdf 100644 --- a/CanlabCore/Model_building_tools/create_design_single_event.m +++ b/CanlabCore/Model_building_tools/create_design_single_event.m @@ -1,4 +1,4 @@ -function [X, e] = create_design_single_event(TR, ISI, eventduration, HPlength, dononlin) +function [X, e] = create_design_single_event(TR, ISI, eventduration, HPlength, dononlin, varargin) % [X, e] = create_design_single_event(TR, ISI, eventduration, HPlength, dononlin) % % Create and plot design for single event @@ -20,6 +20,15 @@ if ~isempty(HPlength) && ~isinf(HPlength), dohpfilt = 1; else dohpfilt = 0; end +% optional inputs with default values +% ----------------------------------- +for i = 1:length(varargin) + if strcmpi(varargin{i}, 'scanLength') + scanLength=varargin{i+1}; + end +end + + if dononlin nonlinstr = 'nonlinsaturation'; else