フィルターのクリア

how i can have dimension input of a defined function like f ?

2 ビュー (過去 30 日間)
xosro
xosro 2015 年 7 月 1 日
回答済み: Walter Roberson 2015 年 7 月 2 日
i have a code that input of its a handle function like f, in duration of this code i need to number of input this function for example f is: f=@(x,y)(x+y)

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 1 日
編集済み: Azzi Abdelmalek 2015 年 7 月 1 日
f=@(x,y)(x+y)
s=func2str(f);
a=regexp(s,'(?<=@\()[\w,]+(?=\))','match')
out=numel(cell2mat(regexp(a,'\w+')))
  1 件のコメント
xosro
xosro 2015 年 7 月 1 日
thank you so much mr Azzi Abdelmalek.

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 7 月 2 日
f = @(x,y)(x+y)
out = nargin(f)

カテゴリ

Help Center および File ExchangeClocks and Timers についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by