MATLAB: How to control duplicate function names

functionnameneural network

I am using the Neural Network toolbox and attempting to determine how a trained patternnet would classify some test data. The documentation indicates I should use "classify" for this purpose. However, when I do so, I get an error message, because (as documented by "which classify") an unrelated function named "classify" is found preferentially on my matlabpath (/Applications/MATLAB_R2016a.app/toolbox/stats/stats/classify.m). If I "examine package contents" (I'm on a Mac), in fact that stats version of classify is the only one found. If I "doc classify" I get the stats version (re: Discriminant analysis), but at the top there is a notation: "Other uses of classify: nnet/SeriesNetwork.classify", and if I follow the offered link I find documentation on the version of classify appropriate for neural networks. How can I make that version of "classify" the one found in response to a command-line entry or a script? The same problem pertains to "predict". This overloading of function names seems like a very bad idea – what gives?

Best Answer