ahajib
ahajib

Reputation: 13510

MATLAB : Use a different version of a function with the same name

I am writing a code in MATLAB where I need to use a function called modwt which exist in two toolboxes that I'm using at the same time (Wavelet and WMTSA). The thing is that one version returns only one output and the other one returns three. How should I indicate which toolbox is the one that I need for a specific code. What I have done so far is trying to import the function using the import command:

import wmsta.dwt.modwt

Which gives me an error regarding that there is something wrong with my import.

Any help is much appreciated. Thanks

Upvotes: 3

Views: 182

Answers (1)

Thierry Dalon
Thierry Dalon

Reputation: 926

You shall prepend/put on the top (using the addpath function) the directory containing the function you want to call in MATLAB path. See https://www.mathworks.com/help/matlab/ref/addpath.html or use function handles as explained here https://stackoverflow.com/a/33776090/2043349

Upvotes: 0

Related Questions