unfoldtoolbox / unfold

A matlab EEG toolbox to perform overlap correction and non-linear & linear regression.
GNU General Public License v3.0
56 stars 14 forks source link

Probably minor issue: repeated elseif with same condition #138

Open chsquare opened 10 months ago

chsquare commented 10 months ago

Hi Bene and Olaf,

I just noticed that cfg.method if-block within uf_glmfit function has two times 'matlab' and two times 'pinv' with slightly different code.

https://github.com/unfoldtoolbox/unfold/blob/caa07fdf1a881a5c31705898392df3f699461aff/src/uf_toolbox/uf_glmfit.m#L125 https://github.com/unfoldtoolbox/unfold/blob/caa07fdf1a881a5c31705898392df3f699461aff/src/uf_toolbox/uf_glmfit.m#L201

https://github.com/unfoldtoolbox/unfold/blob/caa07fdf1a881a5c31705898392df3f699461aff/src/uf_toolbox/uf_glmfit.m#L133 https://github.com/unfoldtoolbox/unfold/blob/caa07fdf1a881a5c31705898392df3f699461aff/src/uf_toolbox/uf_glmfit.m#L210

The output is probably (more or less) the same in both cases, but perhaps still something you want to fix.

Best, Christoph

behinger commented 10 months ago

ha! good catch. I had used those for testing speed of several implementations. Probably I got confused and just let them stand here.

We can simply remove the later one, there is no improvement to be expected exactly as you said.