MATLAB: How do you express this function in MATLAB syntax

MATLAB

?(?) = e^x + sin(5x)
How do you express this function in MATLAB syntax ?

Best Answer

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
Related Question