how shall I replace "inline" function by anonymous function

5 ビュー (過去 30 日間)
vx2008
vx2008 2017 年 1 月 23 日
コメント済み: Stephen23 2017 年 1 月 23 日
if true
myfunc=inline('beta(1)*x+beta(2)','beta','x');
[~,r]=nlinfit(x,y,myfunc,[1,1]);
end
I code as above and Matlab remind me that "inline" will be replaced by anonymous function and deleted in future;
Now how shall I replace "inline" function by anonymous function?

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 1 月 23 日
myfunc = @(beta,x) beta(1)*x + beta(2)
  1 件のコメント
Stephen23
Stephen23 2017 年 1 月 23 日
vx2008's "Answer" moved here:
thanks a lot.

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

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by