How do I fix this code? It says "Conversion to function_handle is not possible" on the line f(×) = (x^4) - (10*x^3) + 5

1 view (last 30 days)
xo = 1; dx = xo; dx = 0.00001; f(x) = (x^4) - (10*x^3) + 5;
P = 1; While P < 0; x1 = x; if f(x1) = 0; exactroot = 0; x2 = x1; P = 0; else x2 = x1 + dx; P = f(x1)*f(x2); x = x2; end end
x1 = a; x2 = b

Answers (1)

Star Strider
Star Strider on 20 Jan 2021
First, fix the typographical errors. Remember that MATLAB is case-sensitive.
Second, see the documentation section on Anonymous Functions.
  5 Comments

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!