user2604504
user2604504

Reputation: 717

Two functions with 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 they take the same parameters in different order. How do I know which function matlab is calling? I want to call the svmtrain function from libsvm. How can I ensure this will happen?

Upvotes: 5

Views: 2095

Answers (1)

Shai
Shai

Reputation: 114896

If you have two functions with the same name, Matlab will call the one that is located closer to the head of your PATH. So, it might be the case that if you call svmtrain from different directories you'll end up calling different functions even if the only change you have made is changing your current working directory.

To know which function matlab is actually using, call the function which from the command line:

>> which svmtrain

Upvotes: 2

Related Questions