📄 05-21.txt
字号:
% find the minimum of the function f(x)=x^3+a*x^2+b*x+c
function [x0,y] = funmin(a,b,c,x1,x2)
options = optimset('Display','off');
[x0,y] = fminbnd(@poly3,x1,x2,options);
function y=poly3(x) %the nested function
y=x^3+a*x^2+b*x+c;
end
% plot the function
fplot(@poly3,[x1,x2]);
hold on;
plot(x0,y,'.');
end
>> [x,y]=funmin(-1000,10,0,600,800)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -