carlson-lab / lpne-data-analysis

1 stars 0 forks source link

changeWelchVersion #10

Closed Noah-Lanier closed 2 years ago

Noah-Lanier commented 2 years ago

Bug

When running saveFeatures.m on the conditional_lsd branch, using the options struct

options.featureList={'power', 'directedSpectrum'}; options.version.power="directed_spectrum_1.0"; options.version.directedSpectrum ="directed_spectrum_1.0"; options.parCores = 8;

The following happens:

Subscript indices must either be real positive integers or logicals. Error in saveFeatures (line 144) if ~(str2double(options.version.(welchFeatures{k})(end-2:end)) >= 1.6)

Expected Behavior

It appears that we want to check the version number of the power, coherence, and directedSpectrum features. Checking the version consists of getting the number associated to the version. Then, if that version number is 1.6 or greater, we want to change the Welch version. However, when attempting to check the version, the subscripting is not working correctly and an error is thrown.

Additional questions and potential future problems

The directedSpectrum features have version directed_spectrum_1.0. While these features are ahead of 1.6, with the current conditional, it appears that they come before (1.0 < 1.6). Should directed_spectrum_1.0 have changeWelchVersion value as true? It also appears that this conditional may cause problems when future feature version numbers pass 1.6. A potential solution is to just write out the entire feature version name and check for that instead of just the number.

Please let me know if you have any questions (or if reporting bugs on the matlab version is not needed given the switch over to python). Thanks :)

Noah-Lanier commented 2 years ago

This issue occurs on Matlab 2017b and not 2021b, so just upgrade the MatLab version.