Adding functions of the same variable to form a new function

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개)

카테고리

도움말 센터File Exchange에서 Google에 대해 자세히 알아보기

제품

질문:

2017년 12월 15일

편집:

2017년 12월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by