LIMO-EEG-Toolbox / limo_tools

Hierarchical Linear Modelling for MEEG data
https://limo-eeg-toolbox.github.io/limo_meeg/
Other
58 stars 28 forks source link

[BUG] version check for parallel toolbox breaks compatibility with Matlab 2018a (worked previously) #147

Closed jnvandermeer closed 1 year ago

jnvandermeer commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Estimating the LIMO parameters yields an error : "All of the input arguments must be of the same size and shape. Previous inputs had size 11 in dimension 2. Input #3 has size 1".

To Reproduce Steps to reproduce the behavior: Estimate LIMO parameters with Matlab 2018a.

In limo_check_ppool.m, there is line 11, on which is written: "strcmpi('Parallel Computing Toolbox',arrayfun(@(x) x.Name, addons, "UniformOutput",false))"

This does not work in Matlab 2018a. A solution is to just replace this with 0, which skips detection of the parallel toolboxes. or to replace with: strcmpi('Parallel Computing Toolbox',{addons.Name}) Which is probably not super clean. But, the arrayfun(@) implementation does not work well for structs in older versions of matlab.

CPernet commented 1 year ago

what about:

addons = ver;  
if any(ismember('Parallel Computing Toolbox', {addons.Name}))  
   ...  
end

does that work for your Matlab version? (yes noticed older versions do not take cell array in many functions like strcmp, contains, etc)

jnvandermeer commented 1 year ago

Yes, that works fine on my older Matlab 2018a.

Many thanks! Johan

CPernet commented 1 year ago

great, thx - solved by https://github.com/LIMO-EEG-Toolbox/limo_tools/commit/f2ac7272103e1ff809de706b8fda0c2646690924