Azzera filtri
Azzera filtri

Subtracting two function handles

12 visualizzazioni (ultimi 30 giorni)
Joe
Joe il 19 Nov 2012
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)

Risposta accettata

Matt J
Matt J il 19 Nov 2012
h=@(x) f(x)-g(x);

Più risposte (0)

Categorie

Scopri di più su Search Path in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by