How do you express this function in MATLAB syntax ?

3 visualizzazioni (ultimi 30 giorni)
𝑓(𝑥) = e^x + sin(5x)
How do you express this function in MATLAB syntax ?

Risposta accettata

KSSV
KSSV il 9 Giu 2020
Modificato: KSSV il 9 Giu 2020
f = exp(x)+sin(5*x) ; % define x before
f = @(x) exp(x)+sin(5*x) ; % call by f(value) This is called Anonymous function
  5 Commenti
KSSV
KSSV il 9 Giu 2020
I gave comments...did you folllow those comments?
Walter Roberson
Walter Roberson il 9 Giu 2020
f = exp(x)+sin(5*x) ;
would be an error if you had not defined x before.

Accedi per commentare.

Più risposte (0)

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by