BlackrockNeurotech/NPMK

Mishandling of numerical arguments in openNSx.m

sbrincat opened this issue · 2 comments

openNSx is set up to take several arguments of the form 'keyword', value, where the value is sometimes numeric. These are handled in the argument hashing by setting the variable next to expect a specific type of argument.

Recent updates adding ischar(inputArgument) && to these lines have broken this behavior (I think it should've gone inside the following big parenthetical block).

Specific example: nsx = openNSx(datafile, 'read', 'channels',1:16);

Previous behavior: <returned data from 1st 16 channels in nsx>

New behavior:
" Error using openNSx
Invalid argument '~|zxvtr}{ywus'. "
(error when arguments fall through entire argument hash, because it wasn't handled properly on line 475)

Bug discovered by our user @jeffersonroy

Please try out the PR in #62 to see if it fixes your issue.

Addressed in #62.