How to code the linear Splines function?
古いコメントを表示
Hi all, I am getting stuck with the code of linear Splines function. The error is: "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side" I appreciate for any help. Thanks!
if true
% code
function out=LSplines(x,pointx,pointy)
n=length(pointx);
for i=2:n
t1(i)= (pointx(i)-x);
b1(i)= (pointx(i)-pointx(i-1));
t2(i)= (x-pointx(i-1));
b2(i)= (pointx(i)-pointx(i-1));
end
P==0;
for i=2:n
P(i)= P(i)+pointy(i-1)*t1(i)/b1(i)+pointy(i)*t2(i)/b2(i)
end
end
end
回答 (1 件)
madhan ravi
2018 年 11 月 12 日
編集済み: madhan ravi
2018 年 11 月 12 日
function out=LSplines(x,pointx,pointy)
n=length(pointx);
for i=2:n
t1(i)= (pointx(i)-x);
b1(i)= (pointx(i)-pointx(i-1));
t2(i)= (x-pointx(i-1));
b2(i)= (pointx(i)-pointx(i-1));
end
P=cell(1,n);
P{1}=0;
for i=2:n
P{i}= P{i-1}+pointy(i-1)*t1(i)/b1(i)+pointy(i)*t2(i)/b2(i);
end
out=P;
end
8 件のコメント
Ni Su
2018 年 11 月 12 日
madhan ravi
2018 年 11 月 12 日
provide your datas
Ni Su
2018 年 11 月 12 日
編集済み: madhan ravi
2018 年 11 月 12 日
Ni Su
2018 年 11 月 12 日
Ni Su
2018 年 11 月 12 日
編集済み: madhan ravi
2018 年 11 月 12 日
Ni Su
2018 年 11 月 12 日
Ni Su
2018 年 11 月 12 日
カテゴリ
ヘルプ センター および File Exchange で Geometric Transformation and Image Registration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
