from Fitting NURBS to a given set of data points by Vikash Gupta
Given a set of six points a closed NURBS curve is used to approximately fit all the six data points.

inputfile1.m
A = [8.1472    2.7850; 
    9.0579    5.4688;
    1.2699    9.5751;
    9.1338    9.6489;
    6.3236    1.5761;
    0.9754    9.7059]; %generated randomly

hold on;
% axis([0,20,0,20]);
% A=ginput(6);
pause

P1(1,:)=[6,1];          
P1(2,:)=[10,0];
P1(3,:)=[10,10];
P1(4,:)=[0,10];
P1(5,:)=[9,7];
P1(6,:)=[6,1];

P2(1,:)=[10,4];          
P2(2,:)=[12,3];
P2(3,:)=[15,5];
P2(4,:)=[12,10];
P2(5,:)=[9.8,7];
P2(6,:)=[10,4];

P3(1,:)=[6.8,10];          
P3(2,:)=[13,14];
P3(3,:)=[10,12];
P3(4,:)=[0,1];
P3(5,:)=[4,7];
P3(6,:)=[6.8,10];

P4(1,:)=[5,6];          
P4(2,:)=[16,8];
P4(3,:)=[14,10];
P4(4,:)=[20,10];
P4(5,:)=[9,7.5];
P4(6,:)=[5,6];

P5(1,:)=[6,4];            
P5(2,:)=[10,13];
P5(3,:)=[19,8];
P5(4,:)=[7,2];
P5(5,:)=[3,7];
P5(6,:)=[6,4];

P6(1,:)=[16,14];            
P6(2,:)=[10,12];
P6(3,:)=[19.3,8.4];
P6(4,:)=[17,12.3];
P6(5,:)=[12,7];
P6(6,:)=[16,14];

P7(1,:)=[21,12];            
P7(2,:)=[18,14];
P7(3,:)=[11,18];
P7(4,:)=[17,20];
P7(5,:)=[13,8];
P7(6,:)=[21,12];

P8(1,:)=[3.6,11];            
P8(2,:)=[12,2.5];
P8(3,:)=[11,7];
P8(4,:)=[7.5,12];
P8(5,:)=[9.5,7.2];
P8(6,:)=[3.6,11];

P9(1,:)=[6.5,12];            
P9(2,:)=[18,18];
P9(3,:)=[11,8.4];
P9(4,:)=[10,2.5];
P9(5,:)=[12,8];
P9(6,:)=[6.5,12];


Contact us at files@mathworks.com