i=0:10;
f=i.^2-10.*i+2;
[fmin,imin]=min(f); % minimum to nearest integer value
To solve for the minimum, couple of ways. Using numerical w/o the symbolic toolbox one is
fsolve(@(x) polyval(polyder([1 -10 2]),x),1)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!