I'm just trying to make a function file with the function f(x)=e^cosx -x^3+2x^2+5x-3

Answers (1)

function y = myFunc(x)
y = exp(cos(x)) - x^3 + 2*x^2 + 5*x -3;
end

1 Comment

Possibly
y = exp(cos(x) - x^3 + 2*x^2 + 5*x - 3);
or possibly
y = exp(cos(x)) - (x^3 + 2*x^2 + 5*x - 3);
or possibly
y = exp(cos(x) - (x^3 + 2*x^2 + 5*x - 3));
.. The notation is somewhat ambiguous.

Sign in to comment.

Categories

Find more on Argument Definitions in Help Center and File Exchange

Tags

Asked:

on 23 Jul 2024

Commented:

on 12 Sep 2024

Community Treasure Hunt

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

Start Hunting!