现在有19个三维空间的点,如何用Matlab拟合出最优曲线?
x=[145.5813150.6686155.0191158.9346162.4105165.3863167.7912169.5607170.6438171.008517...
x=[145.5813 150.6686 155.0191 158.9346 162.4105 165.3863 167.7912 169.5607 170.6438 171.0085 170.6438 169.5607 167.7912 165.3863 162.4105 158.9346 155.0191 150.6686 145.5813];
y=[-237.5000 -211.1111 -184.7222 -158.3333 -131.9444 -105.5556 -79.1667 -52.7778 -26.3889 0 26.3889 52.7778 79.1667 105.5556 131.9444 158.3333 184.7222 211.1111 237.5000];
z=[-225.4700 -220.3091 -216.3220 -212.9549 -210.0987 -207.7343 -205.8701 -204.5223 -203.7065 -203.4334 -203.7065 -204.5223 -205.8701 -207.7343 -210.0987 -212.9549 -216.3220 -220.3091 -225.4700];
x,y,z分别表示19个点在x,y,z上的坐标。下图是19个点在三维空间的坐标位置图示,现在用Matlab拟合出这19个点的最优曲线 展开
y=[-237.5000 -211.1111 -184.7222 -158.3333 -131.9444 -105.5556 -79.1667 -52.7778 -26.3889 0 26.3889 52.7778 79.1667 105.5556 131.9444 158.3333 184.7222 211.1111 237.5000];
z=[-225.4700 -220.3091 -216.3220 -212.9549 -210.0987 -207.7343 -205.8701 -204.5223 -203.7065 -203.4334 -203.7065 -204.5223 -205.8701 -207.7343 -210.0987 -212.9549 -216.3220 -220.3091 -225.4700];
x,y,z分别表示19个点在x,y,z上的坐标。下图是19个点在三维空间的坐标位置图示,现在用Matlab拟合出这19个点的最优曲线 展开
3个回答
展开全部
clear;clc;close all
x=[145.5813 150.6686 155.0191 158.9346 162.4105 165.3863 167.7912 169.5607 170.6438 171.0085 170.6438 169.5607 167.7912 165.3863 162.4105 158.9346 155.0191 150.6686 145.5813];
y=[-237.5000 -211.1111 -184.7222 -158.3333 -131.9444 -105.5556 -79.1667 -52.7778 -26.3889 0 26.3889 52.7778 79.1667 105.5556 131.9444 158.3333 184.7222 211.1111 237.5000];
z=[-225.4700 -220.3091 -216.3220 -212.9549 -210.0987 -207.7343 -205.8701 -204.5223 -203.7065 -203.4334 -203.7065 -204.5223 -205.8701 -207.7343 -210.0987 -212.9549 -216.3220 -220.3091 -225.4700];
values=spcrv([[x(1) x x(end)];[y(1) y y(end)];[z(1) z z(end)]],3,1000);
x=[145.5813 150.6686 155.0191 158.9346 162.4105 165.3863 167.7912 169.5607 170.6438 171.0085 170.6438 169.5607 167.7912 165.3863 162.4105 158.9346 155.0191 150.6686 145.5813];
y=[-237.5000 -211.1111 -184.7222 -158.3333 -131.9444 -105.5556 -79.1667 -52.7778 -26.3889 0 26.3889 52.7778 79.1667 105.5556 131.9444 158.3333 184.7222 211.1111 237.5000];
z=[-225.4700 -220.3091 -216.3220 -212.9549 -210.0987 -207.7343 -205.8701 -204.5223 -203.7065 -203.4334 -203.7065 -204.5223 -205.8701 -207.7343 -210.0987 -212.9549 -216.3220 -220.3091 -225.4700];
values=spcrv([[x(1) x x(end)];[y(1) y y(end)];[z(1) z z(end)]],3,1000);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询