How do you express this function in MATLAB syntax ?

2 Ansichten (letzte 30 Tage)
Emre Can Usengul
Emre Can Usengul am 9 Jun. 2020
Kommentiert: Walter Roberson am 9 Jun. 2020
𝑓(𝑥) = e^x + sin(5x)
How do you express this function in MATLAB syntax ?

Akzeptierte Antwort

KSSV
KSSV am 9 Jun. 2020
Bearbeitet: KSSV am 9 Jun. 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 Kommentare
KSSV
KSSV am 9 Jun. 2020
I gave comments...did you folllow those comments?
Walter Roberson
Walter Roberson am 9 Jun. 2020
f = exp(x)+sin(5*x) ;
would be an error if you had not defined x before.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by