Adding functions of the same variable to form a new function

14 ビュー (過去 30 日間)
Guster
Guster 2017 年 12 月 15 日
編集済み: Guster 2017 年 12 月 15 日
Basically. Say I have two functions like:
f1= @(x)(43*(x^3)+32)
f2 = @(x) (34+9*x - 2*(x^2))
How do I combinde these functions together in matlab
f3= f1+f2
does not do it.

採用された回答

Stephen23
Stephen23 2017 年 12 月 15 日
編集済み: Stephen23 2017 年 12 月 15 日
To add normal MATLAB functions simply define a new function:
f3 = @(x) f1(x) + f2(x);
  1 件のコメント
Guster
Guster 2017 年 12 月 15 日
編集済み: Guster 2017 年 12 月 15 日
Thanks, I couldnt Google it since I didnt know the name was actually function_handle

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by