What is the use of repmat in this code?

1 回表示 (過去 30 日間)
Shipra  Batra
Shipra Batra 2017 年 1 月 7 日
編集済み: Stalin Samuel 2017 年 1 月 7 日
Hello, I was going through this code in Matlab Help regarding constructing a Bspline :-
t = [0.1 0.4 0.5 0.8 0.9];
a = 1;
fnplt(spmak(t,a));
tmp = repmat(t,3,1);
ty = repmat(.1*[1;-1;NaN],1,5);
hold on
plot(tmp(:),ty(:))
text(.65,.5,'B( \cdot | .1, .4, .5, .8, .9)','FontSize',12)
text(.05,1.,'s(x) = \Sigma_j B( x | t_j , \ldots, t_{j+k} ) a(:,j)', ... 'FontSize',16,'Color','r')
axis([0 1 -.2 1.2])
title('A B-spline of Order 4')
hold off
I want to ask why "repmat" function is used in the code when "spmak" should inculcate the iterative measure of calculating the Bspline. Which is function should be used for constructing Bspline like spmak,spapi,bspline etc?

回答 (1 件)

Stalin Samuel
Stalin Samuel 2017 年 1 月 7 日
  2 件のコメント
Shipra  Batra
Shipra Batra 2017 年 1 月 7 日
Hi, Thanks for the early response. But, I want to know what is the significance of using this function in plotting Bspline curve?
Stalin Samuel
Stalin Samuel 2017 年 1 月 7 日
編集済み: Stalin Samuel 2017 年 1 月 7 日

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSplines についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by