Menu

#365 Matlabs new keyword argument syntax causes an error in baumgartner2014

1.7
open
nobody
2025-11-03
2025-11-03
No

Matlab allows to pass keyword arguments as some_function(argument_1, key_word_argument_1=42) since 2021a (https://de.mathworks.com/help/matlab/matlab_prog/namevalue-in-function-calls.html). Previously keyword arguments had to be provided as some_function(argument_1, 'key_word_argument_1', 42).

I found a case where the new syntax causes a problem:

[p, rang, tang] = baumgartner2014(target, template, 'fs', 44100);

works as expected but using

[p, rang, tang] = baumgartner2014(target, template, fs=44100);

returns a p matrix that hase the same value in every row and column.

I did not look into why this is happening and also did not check if this is happening in other functions or just in the example above. This might be a source of errors that might be hard to find/understand for users - hence reporting it here.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB