syms x
ff=x^2-4*x+5;
ff1=diff(ff);
xx=0:.2:4;yy=subs(ff,x,xx);
a1=double(solve(ff1));ya1=double(subs(ff,x,a1));
plot(xx,yy);
hold on
plot(a1,ya1,'b*');
text(a1,ya1,'极小值点');
只有极小值点,开口向上
syms x
ff=x^2-4*x+5;
ff1=diff(ff);
xx=0:.2:4;yy=subs(ff,x,xx);
a1=double(solve(ff1));ya1=double(subs(ff,x,a1));
plot(xx,yy);
hold on
plot(a1,ya1,'b*');
text(a1,ya1,'极小值点');
只有极小值点,开口向上