04-53.txt
来自「MATLABR2006a基础教程」· 文本 代码 · 共 14 行
TXT
14 行
% 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 + =
减小字号Ctrl + -
显示快捷键?