Doubts in setting matlab path

1 回表示 (過去 30 日間)
sudharsan t
sudharsan t 2013 年 8 月 19 日
Hello ppl,
I have some doubts while setting the path for matlab. The default path is ...../Matlab I have several folders inside this folder . LEt A,B,C,D be the subfolders all these have the same functions but a slight modification inside it (just a number change in constant defined inside these functions). I used to work randomly with the sub folders .
Each time i setted up the path def file inside A,B,c,D . Now the question is
if i run a function
*function Dyn(X)
....
filip(y) %%subfunction
end*
in subfolder A , and the matlab path is at /Matlab/D, it runs , and i am not sure whether it uses the filip(y) from folder A or D ?
What should i do now ?
Thanks in advance

回答 (2 件)

Amith Kamath
Amith Kamath 2013 年 8 月 19 日
http://www.mathworks.com/help/matlab/matlab_prog/function-precedence-order.html answers your question exactly. I believe MATLAB looks in the current directory first and then looks at other directories based on its order in the path.

Image Analyst
Image Analyst 2013 年 8 月 19 日
Give this command:
which -all filip
and it will tell you the order.

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by