Advertisement
rdiazfuentes

Untitled

Nov 30th, 2020
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. % interpolated points
  2. P = [0 1; 1 3; 6 2; 3 0];
  3. plot([P(:,1);P(1,1)],[P(:,2);P(1,2)],'*b-')
  4. hold on
  5.  
  6. M = toeplitz([1/2 0 0 1/2],[1/2 1/2 0 0]);
  7. L = toeplitz([3/4 1/8 0 1/8]);
  8.  
  9. % solution to the interpolation problem
  10. cP = pinv(M)*P;
  11. tP = L\P;
  12.  
  13. % subdivision curve for each solution
  14. stP = SubdivS(tP,5,[1/4 3/4 3/4 1/4]);
  15. scP = SubdivS(cP,5,[1/4 3/4 3/4 1/4]);
  16.  
  17. plot([stP(:,1);stP(1,1)],[stP(:,2);stP(1,2)],'*g-')
  18. plot([scP(:,1);scP(1,1)],[scP(:,2);scP(1,2)],'*m-')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement