How get the information whether a dependency function exist or not?

2 ビュー (過去 30 日間)
Matti
Matti 2013 年 10 月 28 日
コメント済み: Matti 2013 年 10 月 28 日
The function "depfun" gives back all the dependency functions of a certain function. But if there is a typo in a sub function call, than this dependency function wont neither be detected nor there is an error message that these fuction doesn't exist.
How it's possible to check automatic whether all dependency functions exist, not doing this manual (i.e. exist) ...?

回答 (1 件)

Vishal Rane
Vishal Rane 2013 年 10 月 28 日
Try this:
cellfun( @(x)(exist(x)), (depfun(your_file_name)))
  1 件のコメント
Matti
Matti 2013 年 10 月 28 日
thanks, but it doesn't detect that the function "bar2" doesn't exist in the example 2
-----------------------------------
example 1 -> thats working
function f = foo ()
f = bar();
end
function b = bar()
b = 1;
end
------------------------------------
example 2 -> not working:
function f = foo ()
f = bar2();
end
function b = bar()
b = 1;
end

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by