spline_kezd.m

来自「Incorporating Prior Knowledge in Cubic S」· M 代码 · 共 46 行

M
46
字号

cav = ca;
cbv = cb;
ccv = cc;

n=length(knots); %number of nodes
nc=3; %number of components
%no hard constr.
A = []; b = [];
An = []; bn = [];
%no soft. constr.
s = [];
lambda1 = 0;
lambda2 = 0;
w = [0 0 0];
sum1 = 0;
sum2 = 0;

%Kiindulasi pont
A = zeros(3,3*2*n);
b = zeros(3,1);
A(1,1) = 1;
A(2,2*n+1) = 1;
A(3,4*n+1) = 1;
b(1) = ca0;
b(2) = cb0;
b(3) = cc0;

A=[];
b=[];

%spline
[spa1,spb1,spc1] = fspline3([tt,tt,tt],[cav,cbv,ccv],knots,s,lambda1,lambda2,w,sum1,sum2,A,b,An,bn);

%Results: t,c
cnew = zeros(length(te),3);
if ~exist('colorstr'),
  cnew(:,1) = drawspline(spa1,te);
  cnew(:,2) = drawspline(spb1,te);
  cnew(:,3) = drawspline(spc1,te);
else
  cnew(:,1) = drawspline(spa1,te,colorstr{1});
  cnew(:,2) = drawspline(spb1,te,colorstr{2});
  cnew(:,3) = drawspline(spc1,te,colorstr{3});
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?