How to pass an argument to a function inside varfun?

7 ビュー (過去 30 日間)
Jose Granados Vergara
Jose Granados Vergara 2018 年 11 月 20 日
回答済み: Walter Roberson 2018 年 11 月 20 日
I'm using varfun to run functions on a table
varfun(@Foo, data_table);
The function has an additional argument "arg1" besides the table:
function Y = Foo(X, arg1)
Something like:
varfun(@Wrr, signals, fs);
Gives "Wrong number of arguments error". How can I pass the fs argument to the function inside varfun?

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 11 月 20 日
paramaterize the anonymous function
varfun(@(ss)Wrr(ss,fs), signals )

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by