"Undefined function" errors are commonly not because of the wrong type of input argument, but because MATLAB can't find the file. To call a function it should be:
- In an *.m file with the same name as the function (e.g.
myfunc.m
for function myfunc
)
- In the current working folder or on the MATLAB path, which tells MATLAB where to look for files.
Normally when installing a MATLAB toolbox it will automatically be added to the path, but third-party toolboxes often need to be manually added. Make sure you add all subdirectories as well. You can do this using genpath
in addition to addpath
:
addpath(genpath('c:/matlab/mytoolbox'))
There is also a graphical interface for changing the MATLAB path, accessible from the commandline by typing pathtool
. Again, for a toolbox, use "Add with Subfolders".
which dwt2
from command line should show it). – nkjtwhich dwt2
into your commandline. If the toolbox is properly installed, it should return the location of the file. If it doesn't, you need to change yourpath
to include the location of the toolbox, because MATLAB doesn't search your entire harddrive to find a function. – nkjt