matlab 求曲线与x轴的正负面积之和y=[-61.429,-58.635,-57.02,-54.306,-53.42,-50.796,-49.6,-36.278,35.735,146.684,259.955,332.941,372.657,398.11,387.08,370.301,309.843,242.748,130.381,17.412,-57.716,-80.582,-72.352,-63.972]x=[0:1:23]每个y
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/04 17:04:00
matlab 求曲线与x轴的正负面积之和y=[-61.429,-58.635,-57.02,-54.306,-53.42,-50.796,-49.6,-36.278,35.735,146.684,259.955,332.941,372.657,398.11,387.08,370.301,309.843,242.748,130.381,17.412,-57.716,-80.582,-72.352,-63.972]x=[0:1:23]每个y
matlab 求曲线与x轴的正负面积之和
y=[-61.429,-58.635,-57.02,-54.306,-53.42,-50.796,-49.6,-36.278,35.735,146.684,259.955,332.941,372.657,398.11,387.08,370.301,309.843,242.748,130.381,17.412,-57.716,-80.582,-72.352,-63.972]
x=[0:1:23]
每个y对应个X画的曲线图,然后求在X轴上0—23,曲线所围成的面积,如果光求负的面积或者正的面积又怎么求呢?
matlab 求曲线与x轴的正负面积之和y=[-61.429,-58.635,-57.02,-54.306,-53.42,-50.796,-49.6,-36.278,35.735,146.684,259.955,332.941,372.657,398.11,387.08,370.301,309.843,242.748,130.381,17.412,-57.716,-80.582,-72.352,-63.972]x=[0:1:23]每个y
设步长h=0.001;
x=[0:1:23];
y=[-61.429,-58.635,-57.02,-54.306,-53.42,-50.796,-49.6,-36.278,35.735,146.684,259.955,332.941,372.657,398.11,387.08,370.301,309.843,242.748,130.381,17.412,-57.716,-80.582,-72.352,-63.972];
plot(x,y,'*-')
>> x0=0:0.001:23;
>> y0=spline(x,y,x0);
>> y1=y0.*(y0> y2=y0.*(y0>0);
>> S1=trapz(y1)*0.001
S1 =
-631.1020
>> S2=trapz(y2)*0.001
S2 =
3.0021e+003