BlackrockNeurotech / NPMK

Neural Processing Matlab Kit is a set of functions for loading and manipulating data from Blackrock Microsystems' data files (.CCF, .NEV, .NSx).
46 stars 57 forks source link

Mishandling of numerical arguments in openNSx.m #60

Closed sbrincat closed 10 months ago

sbrincat commented 10 months ago

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

cboulay commented 10 months ago

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

sskellis commented 10 months ago

Addressed in #62.