mickcrosse / mTRF-Toolbox

A MATLAB package for modelling multivariate stimulus-response data
https://cnspworkshop.net
BSD 3-Clause "New" or "Revised" License
78 stars 29 forks source link

mTRFplot #15

Open alexisdmacintyre opened 1 year ago

alexisdmacintyre commented 1 year ago

Describe the bug When plotting a multi-lag encoding model without averaging over channels in the TRF style, the model weights are the wrong dimension for the final call to plot: model.w is size 1 x n lags x n channels.

To Reproduce

mTRFplot(theModel)

Error using plot Data cannot have more than 2 dimensions.

Error in mTRFplot (line 92) h = plot(model.t,model.w,'linewidth',3); grid on

Temporary fix

I added this before the plot command

if any(size(model.w)==1)
    model.w = squeeze(model.w);
end