怎么用MATLAB求二次函数最小值我用x=[42.8,42.9,43,43.1,43.2,43.3,43.4,43.5,43.6,43.7,43.8,43.9,44,44.1,44.2,44.3,44.4,44.5,44.6,44.7];>> y=[23265,23029,22907,22668,22264,22083,22112,22096,21864,21742,21733,21844,21787,21756,21838,21984,219

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 09:11:25
怎么用MATLAB求二次函数最小值我用x=[42.8,42.9,43,43.1,43.2,43.3,43.4,43.5,43.6,43.7,43.8,43.9,44,44.1,44.2,44.3,44

怎么用MATLAB求二次函数最小值我用x=[42.8,42.9,43,43.1,43.2,43.3,43.4,43.5,43.6,43.7,43.8,43.9,44,44.1,44.2,44.3,44.4,44.5,44.6,44.7];>> y=[23265,23029,22907,22668,22264,22083,22112,22096,21864,21742,21733,21844,21787,21756,21838,21984,219
怎么用MATLAB求二次函数最小值
我用x=[42.8,42.9,43,43.1,43.2,43.3,43.4,43.5,43.6,43.7,43.8,43.9,44,44.1,44.2,44.3,44.4,44.5,44.6,44.7];
>> y=[23265,23029,22907,22668,22264,22083,22112,22096,21864,21742,21733,21844,21787,21756,21838,21984,21971,21876,21879,21996];
>> p2=ployfit(x,y,2);
求出了
p2 =
1.0e+006 *
0.0009 -0.0821 1.8314
请问下,我要怎么求这个函数的最小值及其横坐标呢?麻烦大虾解决下~
我也试过求函数的对称轴x=-b/2a,x=45.6111.但是我把上面的点输入MATLAB二次拟合的曲线在图像上看着最小点在44°左右,根本不会在45°上面去,其中是什么回事啊?

怎么用MATLAB求二次函数最小值我用x=[42.8,42.9,43,43.1,43.2,43.3,43.4,43.5,43.6,43.7,43.8,43.9,44,44.1,44.2,44.3,44.4,44.5,44.6,44.7];>> y=[23265,23029,22907,22668,22264,22083,22112,22096,21864,21742,21733,21844,21787,21756,21838,21984,219
clc;clear
x=[42.8,42.9,43,43.1,43.2,43.3,43.4,43.5,43.6,43.7,43.8,43.9,44,44.1,44.2,44.3,44.4,44.5,44.6,44.7];
y=[23265,23029,22907,22668,22264,22083,22112,22096,21864,21742,21733,21844,21787,21756,21838,21984,21971,21876,21879,21996];
p2=polyfit(x,y,2)
xx=min(x):0.1:max(x);
yy=polyval(p2,x);
Y=vpa(poly2sym(p2,'x'),6)%转化为多项式格式
Y1=diff(Y)%求一阶导数
Xmin=eval(solve(Y1))%一阶导数等于零,极值点
Ymin=polyval(p2,Xmin)
plot(x,y,'o',xx,yy,Xmin,Ymin,'*')
结果:
p2 =
        932.1       -82142  1.8314e+006
 
Y =
 
932.103*x^2-82142.3*x+.183145e7
 
 
 
Y1 =
 
1864.206*x-82142.3
 
 
Xmin =
       44.063
Ymin =
        21734

用matlab一元二次函数怎么解 用matlab求z=x+y这个函数的最小值条件是x>=1,y>=x+2请问这个用matlab怎么编程? 数学二次函数最小值(x-1)(x-3)的最小值怎么求f(x) 怎么用MATLAB求二次函数最小值我用x=[42.8,42.9,43,43.1,43.2,43.3,43.4,43.5,43.6,43.7,43.8,43.9,44,44.1,44.2,44.3,44.4,44.5,44.6,44.7];>> y=[23265,23029,22907,22668,22264,22083,22112,22096,21864,21742,21733,21844,21787,21756,21838,21984,219 二次函数的最大值最小值怎么求 二次函数的最大最小值怎么求 二次函数的最大,最小值怎么求? matlab 函数求最小值matlab用函数求一元函数的极小值点syms x;y=x^2;fmin=inline('y');a=fminbnd(fmin,-1,1)我用这个算出来,结果a是-1,不知何故? 如何用matlab求函数最优解我要求函数在最小值下的x解怎么办啊min 100000/x+333xx在[1,100]之间的整数.求大神用matlab告知 用matlab求三个自变量函数最小值的M程序? MATLAB二元函数求极值小弟一方程:f=x^2+2*x-3*y+y^2,x范围2~6,y范围4~7,求f最小值,用MATLAB编程怎么做? 二次函数y=x²+4的最小值求这个用什么公式? 数学那些二次函数求最小值用的是什么方法,具体怎么用? 数学那些二次函数求最小值用的是什么方法,具体怎么用? 怎么用matlab求一个三元二次函数的最小值?函数是Y= -22.92X1+52.32X2+10.90X3+2.62X1X2-11.41X1X3+17.93X2X3+1.58X1^2-28.57X2^2+18.11X3^2+220.65,X1,X2,X3的取值范围都是[-1.682,1.682],希望能给我写一下具体的编程,还有X0 matlab 最小值函数怎么表达 怎么用matlab求函数参数 用MATLAB求f(x)=x^3+2*x^2+x-5的最大值和最小值大哥我要的是用MATLAB做的!!!!!!!!!!!!!!!!!