Skip to content

Commit c845ffe

Browse files
committed
now catching errors with unavailable cheby1 function or wrong chebyOrder when checking user settings
1 parent 578f817 commit c845ffe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

functions/I2MC/I2MCfunc.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@
9191
par.maxdisp = par.xres*0.2*sqrt(2); % maximum displacement during missing for interpolation to be possible
9292
end
9393

94+
% check filter
95+
if par.downsampFilter
96+
assert(exist('cheby1','file')==2,'I2MCfunc: When setting the ''downsampFilter'' option to true, the function ''cheby1'' from the signal processing toolbox is required. It appears this function is not available in your installation. Set the option to 0.')
97+
nSampRequired = max(1,3*par.chebyOrder)+1; % nSampRequired = max(1,3*(nfilt-1))+1, where nfilt = chebyOrder+1
98+
nSampInWin = round(par.windowtime/(1/par.freq));
99+
assert(nSampInWin>=nSampRequired,'I2MCfunc: Filter parameters requested with the setting ''chebyOrder'' will not work for the sampling frequency of your data. Please lower ''chebyOrder'', or set the setting ''downsampFilter'' to 0')
100+
end
101+
94102
% setup visual angle conversion
95103
pixpercm = mean([par.xres par.yres]./par.scrSz(:).');
96104
rad2deg = @(x) x/pi*180;

0 commit comments

Comments
 (0)