How do you express this function in MATLAB syntax ?
1 view (last 30 days)
Show older comments
𝑓(𝑥) = e^x + sin(5x)
How do you express this function in MATLAB syntax ?
0 Comments
Accepted Answer
KSSV
on 9 Jun 2020
Edited: KSSV
on 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 Comments
Walter Roberson
on 9 Jun 2020
f = exp(x)+sin(5*x) ;
would be an error if you had not defined x before.
More Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!