Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- funk = '3*x^2-6*x+1';
- f = inline(funk);
- a = -10;
- b = 10;
- minv = f(a);
- minx = a;
- fb = f(b);
- if fb < minv
- minv = fb;
- minx = b;
- end
- d = diff(sym(funk));
- mzerowe = solve(d);
- for i=1:length(mzerowe)
- if f(mzerowe) < minv
- minv = f(mzerowe);
- minx = mzerowe;
- end
- end
- minv
- minx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement