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.

[xh,xs,xl,fh,fs,fl]=sorting(guess,fnvalue)
 function [xh,xs,xl,fh,fs,fl]=sorting(guess,fnvalue)

fn=[fnvalue',(1:9)'];


[worst,indw]=max(fn(:,1));

xh = guess{fn(indw,2)};
fh=worst;

fn(indw,:)=[];
[sworst,indsw]=max(fn(:,1));

fs=sworst;
xs=guess{fn(indsw,2)};

[least,indl]=min(fn(:,1));

xl=guess{fn(indl,2)};
fl=least;




Contact us at files@mathworks.com