klabhub / neurostim

Design and run visual neuroscience experiments using Matlab and the Psychophysics Toolbox.
MIT License
4 stars 3 forks source link

FrameDrop.block dimension #200

Closed dshimaoka closed 1 year ago

dshimaoka commented 1 year ago

Not sure how this happened, but multiple of my cic record had a weird dimension in frameDrop.block such as:

frDr = get(o.cic.prms.frameDrop,'trial',p.trial,'struct',true); frDr =

struct with fields:

     data: [21×2 double]
    trial: [21×1 double]
trialTime: [21×1 double]
     time: [21×1 double]
    block: [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
    frame: [21×1 double]

Obviously the right dimension is 21x1. The incorrect dimension causes an error at neurostim/noiseclut.m at line 277: frDr = structfun(@(x) x(stay,:),frDr,'unif',false);

A simple hack is to add the following lines: if size(frDr.block,1) < size(frDr.block,2) frDr.block = frDr.block'; end

bartkrekelberg commented 1 year ago

@dshimaoka , I committed a bug fix that should solve this. Please pull and try it out.

dshimaoka commented 1 year ago

Splendid!