Two functions with the same name in Matlab

I am using libsvm in matlab and I am trying to call svmtrain. However, I know that Matlab also has a built-in function called svmtrain. I believe that they take the same parameters in a different order. How to find out what function the matlab function performs? I want to call a function svmtrainfrom libsvm. How can I guarantee that this will happen?

+4
source share
1 answer

If you have two functions with the same name, Matlab will name one that is closer to your head PATH. Thus, it may happen that if you call svmtrainfrom different directories, you will end up calling different functions, even if only the change you make changes your current working directory.

To find out which function actually uses matlab, call the function whichfrom the command line:

>> which svmtrain
+2
source

Source: https://habr.com/ru/post/1537455/


All Articles