MATLAB Answers


How to direct Matlab on which function to execute?

Asked by Louis
on 12 Nov 2014
Latest activity Commented on by Louis
on 13 Nov 2014
Matlab has a PCA function, and I have implemented a PCA function.
In one script, I want to compare the results of Matlab's PCA versus mine. How can I do that?
I agree it is it not a wise idea to have conflict functions. A solution would be changing the name of my PCA, but I have many dependencies on my PCA so it is a hassle to change all the names.
Also, I can remove my PCA directory from the "path" in order to force matlab to use its function, but I don't see it as the correct way as well.
Is there a way to tell Matlab which PCA to use?
Thank you


Sign in to comment.

1 Answer

Answer by the cyclist
on 13 Nov 2014
 Accepted Answer

At the command prompt, type
which -all pca
to see the full path to MATLAB's pca command and yours.
Reference the full path to the MATLAB function when you want to use it.

  1 Comment

Great, thank you

Sign in to comment.