如何用matlab求拟合曲线最大值y0=[112.1 102.9 96.2 88.4 82.5 77.4 72.9 70.6 67.5 63.9 61.5 60.2 58.9 57.7 56.5 55.3 52.3 50.1 44.6 39.5 34.8 25.5 15.4 8.5]; x0=[0.53 1.49 2.39 3.28 4.24 4.76 5.30 5.59 5.85 6.27 6.59 6.78 6.96 7.11 7.26 7.34
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/27 12:34:15
如何用matlab求拟合曲线最大值y0=[112.1 102.9 96.2 88.4 82.5 77.4 72.9 70.6 67.5 63.9 61.5 60.2 58.9 57.7 56.5 55.3 52.3 50.1 44.6 39.5 34.8 25.5 15.4 8.5]; x0=[0.53 1.49 2.39 3.28 4.24 4.76 5.30 5.59 5.85 6.27 6.59 6.78 6.96 7.11 7.26 7.34
如何用matlab求拟合曲线最大值
y0=[112.1 102.9 96.2 88.4 82.5 77.4 72.9 70.6 67.5 63.9 61.5 60.2 58.9 57.7 56.5 55.3 52.3 50.1 44.6 39.5 34.8 25.5 15.4 8.5];
x0=[0.53 1.49 2.39 3.28 4.24 4.76 5.30 5.59 5.85 6.27 6.59 6.78 6.96 7.11 7.26 7.34 7.76 8.12 8.48 8.68 8.83 9.06 9.27 9.40];
x=0.53:0.01:9.40;
y=spline(x0,y0,x);
plot(x0,y0,'o',x,y),grid on
已拟合曲线,要求出x*y的最大值并在曲线上标出坐标.
如何用matlab求拟合曲线最大值y0=[112.1 102.9 96.2 88.4 82.5 77.4 72.9 70.6 67.5 63.9 61.5 60.2 58.9 57.7 56.5 55.3 52.3 50.1 44.6 39.5 34.8 25.5 15.4 8.5]; x0=[0.53 1.49 2.39 3.28 4.24 4.76 5.30 5.59 5.85 6.27 6.59 6.78 6.96 7.11 7.26 7.34
接上述代码:
A=x.*y;a=find(A==max(A));hold on;plot(x(a),y(a),'*')
x*y最大的点用*号标出了,不过有点不显眼