Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two functions with same name in Matlab

Tags:

matlab

libsvm

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?

like image 530
user2604504 Avatar asked Nov 02 '22 01:11

user2604504


1 Answers

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
like image 166
Shai Avatar answered Nov 15 '22 10:11

Shai