x = [0.0, 0.05, 0.103448, 0.151515, 0.2, 0.25, 0.301972]; y = [-0.919674, -0.447321, -0.277143, -0.101953, 0.009087, 0.10446,0.19854];

%使用B样条拟合 t = linspace(0,1,length(x)); pp = spline(t,[x;y]); tt = linspace(0,1,1000); xx = ppval(pp,tt);

%求导 dpp = fnder(pp); dxx = ppval(dpp,tt);

%画图 figure; plot(x,y,'o',xx(1,:),xx(2,:),'r'); title('B-spline拟合'); xlabel('x'); ylabel('y');

figure; plot(xx(1,:),dxx,'r'); title('一阶导数'); xlabel('x'); ylabel('dy/dx');

使用matlab编写代码x和y分别为一组形如x = 00 005 0103448 0151515 02 025 0301972和y = -0919674 -0447321 -0277143 -0101953 0009087 010446019854的列表代表散点图的横纵坐标值请使用B样条拟合该散点图并将拟合后的曲线求导后画出来

原文地址: https://www.cveoy.top/t/topic/K0O 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录