matlab 曲线斜率已知两组数x=[ 0.623 0.747 0.895 1.0738 1.287 1.543 1.849 2.217 2.657 3.184 3.784 4.384 4.984 5.584 6.184 6.784 7.384 7.984],y=[0 0 0 0 0 2.5 e-28 3.8e-23 6.3e-17 1.7e-09 0.00187 0.01421 0.029 0.0446 0.060 0.0771 0.093 0.110 0.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/16 13:43:21
matlab 曲线斜率已知两组数x=[ 0.623 0.747 0.895 1.0738 1.287 1.543 1.849 2.217 2.657 3.184 3.784 4.384 4.984 5.584 6.184 6.784 7.384 7.984],y=[0 0 0 0 0 2.5 e-28 3.8e-23 6.3e-17 1.7e-09 0.00187 0.01421 0.029 0.0446 0.060 0.0771 0.093 0.110 0.
matlab 曲线斜率
已知两组数x=[ 0.623 0.747 0.895 1.0738 1.287 1.543 1.849 2.217 2.657 3.184 3.784 4.384 4.984
5.584 6.184 6.784 7.384 7.984],y=[0 0 0 0 0 2.5 e-28 3.8e-23 6.3e-17 1.7e-09 0.00187 0.01421 0.029 0.0446 0.060 0.0771 0.093 0.110 0.127]用matlab画出曲线和求出各个点的斜率怎么实现啊?
matlab 曲线斜率已知两组数x=[ 0.623 0.747 0.895 1.0738 1.287 1.543 1.849 2.217 2.657 3.184 3.784 4.384 4.984 5.584 6.184 6.784 7.384 7.984],y=[0 0 0 0 0 2.5 e-28 3.8e-23 6.3e-17 1.7e-09 0.00187 0.01421 0.029 0.0446 0.060 0.0771 0.093 0.110 0.
采用插值后差分代微分的方法求斜率.
% begin
x=[ 0.623 0.747 0.895 1.0738 1.287 1.543 1.849 2.217 2.657 3.184 3.784 4.384 4.984 5.584 6.184 6.784 7.384 7.984];
y=[0 0 0 0 0 2.5e-28 3.8e-23 6.3e-17 1.7e-09 0.00187 0.01421 0.029 0.0446 0.060 0.0771 0.093 0.110 0.127];
% 插值
dx = 1e-3;
xi = min(x):dx:max(x);
yi = interp1(x, y, xi);
plot(x, y, 'o', xi, yi);
% 求差分
dyi = [0 diff(yi)] / dx;
% 找原来的x点对应的dy:
dy = interp1(xi, dyi, x);
得到的dy就是各个x点处的斜率值.