Subtracting two function handles

조회 수: 10 (최근 30일)
Joe
Joe 2012년 11월 19일
I was wondering how I could subtract values from two anonymous functions to yield a new function handle. for example:
f = @sin
g = @cos
and I want to define
h = f - g, such that h = @(sin - cos)

채택된 답변

Matt J
Matt J 2012년 11월 19일
h=@(x) f(x)-g(x);
  댓글 수: 1
Joe
Joe 2012년 11월 19일
Thank you so much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Function Handles에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by