syms x
f=x^2-3*x+2;
df=diff(f,x);
x0=eval(solve(df));
x=[-10 x0 10];
y=x.^2-3*x+2;
fmin=min(y)
syms x
f=(2*x^2-3*x+4)/(x^2+2*x+2);
df=diff(f,x);
x0=eval(solve(df));
x=[-1 x0(1) 3];
y=(2*x.^2-3*x+4)./(x.^2+2*x+2);
fmin=min(y)
这是前两个
syms x
f=x^2-3*x+2;
df=diff(f,x);
x0=eval(solve(df));
x=[-10 x0 10];
y=x.^2-3*x+2;
fmin=min(y)
syms x
f=(2*x^2-3*x+4)/(x^2+2*x+2);
df=diff(f,x);
x0=eval(solve(df));
x=[-1 x0(1) 3];
y=(2*x.^2-3*x+4)./(x.^2+2*x+2);
fmin=min(y)
这是前两个