如何用matlab求面积?y=[0.04972,0.07812,0.13424,0.18009,0.21851,0.24797,0.26592,0.28132,0.29462,0.30413,0.31318];x=[0.00005,0.00439,0.00996,0.015,0.02009,0.02502,0.03005,0.03504,0.04007,0.04505,0.05004];y为压缩应力(Mpa),x为压缩位移

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/21 20:44:46
如何用matlab求面积?y=[0.04972,0.07812,0.13424,0.18009,0.21851,0.24797,0.26592,0.28132,0.29462,0.30413,0.31

如何用matlab求面积?y=[0.04972,0.07812,0.13424,0.18009,0.21851,0.24797,0.26592,0.28132,0.29462,0.30413,0.31318];x=[0.00005,0.00439,0.00996,0.015,0.02009,0.02502,0.03005,0.03504,0.04007,0.04505,0.05004];y为压缩应力(Mpa),x为压缩位移
如何用matlab求面积?
y=[0.04972,0.07812,0.13424,0.18009,0.21851,0.24797,0.26592,0.28132,0.29462,0.30413,0.31318];
x=[0.00005,0.00439,0.00996,0.015,0.02009,0.02502,0.03005,0.03504,0.04007,0.04505,0.05004];
y为压缩应力(Mpa),x为压缩位移(mm).数据是从excel表中抄下来的.压缩时每分钟3mm,0.1秒取1个数.上面取的x的11个数就是1秒内的压缩位移(从0-1秒),y是对应的压缩应力.求x,y组成的这条曲线与x轴围成的面积.(可以把它看做一个一个的梯形累加而成的,用cumsum.给个具体的程序吧,我不会编程,还有这个只是1秒的数据,如何应用到1分钟?2分钟?)

如何用matlab求面积?y=[0.04972,0.07812,0.13424,0.18009,0.21851,0.24797,0.26592,0.28132,0.29462,0.30413,0.31318];x=[0.00005,0.00439,0.00996,0.015,0.02009,0.02502,0.03005,0.03504,0.04007,0.04505,0.05004];y为压缩应力(Mpa),x为压缩位移
N = length(x);
interv_x = zeros( 1,N - 1 );
mid_y = zeros( 1,N - 1);
for i = 2 :length(x)
mid_y(i-1) = ( y(i) + y(i-1) ) / 2;
interv_x(i - 1) = x(i) - x(i-1);
end
% 面积
area = interv_x * mid_y';
对于1分钟,2分钟的数据,直接调用这段代码都可以计算.