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