my matlab code to make 2601points from one airfoil

%ytsunsh [at] g m a i l[dot]com
%www.shfrp.com
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%make a new variable as “input” in matlab
%x y

%0.0000 0.00000
%0.00004 0.00203
%0.00037 0.00550
%0.0011 0.00874
%0.00234 0.01186
%0.00405 0.01499
%0.01212 0.02520
%…
%1.00000 0.00000
%…
%0.0000 0.00000

%(from 0,0 through upside to 1,0 then through downside to 0,0)

%then run this function the variable"output"gives out the result

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%[][][][][][][][][][][][][][][][][][][][][][][][]
b2=size(input)*[1;0];
for i=1:b2;
if input(i,1)==1
b1=i;
break;
end
end
for i=1:b2;
if input(i,1)>0.12
b3=i;
break;
end
end
for i=b2:-1:1;
if input(i,1)>0.12
b4=i;
break;
end
end
%[][][][][][][][][][][][][][][][][][][][][][][][]
uper(1:1:b1,1)=input(1:1:b1,1);
uper(1:1:b1,2)=input(1:1:b1,2);
down(1:b2+1-b1,1)=input(b2:-1:b1,1);
down(1:b2+1-b1,2)=input(b2:-1:b1,2);
%[][][][][][][][][][][][][][][][][][][][][][][][]
uper1(1:5,1)=0:0.000125:0.00050;
uper1(5:299,1)=0.0005:0.00025:0.074;
uper1(299:451,1)=0.074:0.0005:0.15;
uper1(451:1301,1)=0.15:0.001:1;
%[][][][][][][][][][][][][][][][][][][][][][][][]
uper1(:,2)=spline(uper(:,1),uper(:,2),uper1(:,1));%
%[][][][][][][][][][][][][][][][][][][][][][][][]
down1(:,1)=uper1(1301:-1:1,1);
down1(:,2)=spline(down(:,1),down(:,2),down1(:,1));%
%[][][][][][][][][][][][][][][][][][][][][][][][]
leading(1:b3,1)=input(b3:-1:1,1);
leading(1:b3,2)=input(b3:-1:1,2);
leading(b3:b3-b4+b2,1)=input(b2:-1:b4,1);
leading(b3:b3-b4+b2,2)=input(b2:-1:b4,2);
%[][][][][][][][][][][][][][][][][][][][][][][][]
i=0:0.0005:leading(1,2);
i=max(i);%
leading1(:,2)=i:-0.0005:leading(b3-b4+b2,2);%
leading1(:,1)=spline(leading(:,2),leading(:,1),leading1(:,2));%

iend=-((leading(b3-b4+b2,2)-leading(1,2))/0.0005);
for i=1:1:iend;
if leading1(i,1)==min(leading1(:,1))%
itemp=i;%
%break;
end
end
clear iend;

leadingup(:,1)=leading1(1:itemp,1);%
leadingup(:,2)=leading1(1:itemp,2);
leadingdown(:,1)=leading1(itemp:i,1);
leadingdown(:,2)=leading1(itemp:i,2);

clear i;%

uper1(1:351,2)=interp1(leadingup(:,1),leadingup(:,2),uper1(1:351,1),‘linear’);
down1(1301:-1:950,2)=interp1(leadingdown(:,1),leadingdown(:,2),down1(1301:-1:950,1),‘linear’);
%[][][][][][][][][][][][][][][][][][][][][][][][]
clear output;
output(1:1301,1)=uper1(:,1);
output(1:1301,2)=uper1(:,2);
output(1301:2601,1)=down1(:,1);
output(1301:2601,2)=down1(:,2);
%[][][][][][][][][][][][][][][][][][][][][][][][]
clear leading;
clear leadingup;
clear leadingdown;
clear leading1;
clear itemp;
clear uper;
clear uper1;
clear down;
clear down1;
clear b1;
clear b2;
clear b3;
clear b4;
clear inner;
%end