clc
clear
Z_ALL=importdata('2Z_Ture.xlsx');
Z_ALL=(6000-Z_ALL)*0.001;

zz0=Z_ALL(:,1);   
zz1=Z_ALL(:,2);   
zz2=Z_ALL(:,3);   
zz3=Z_ALL(:,4);   
zz4=Z_ALL(:,5);   
zz5=Z_ALL(:,6);   
zz6=Z_ALL(:,7);   
zz7=Z_ALL(:,8);   
zz8=Z_ALL(:,9);   
zz9=Z_ALL(:,10);   
zz10=Z_ALL(:,11);   
% zz11=Z_ALL(:,12);   


original_data1=importdata('2y0.xlsx'); %上传数据
original_data2=importdata('2z0.xlsx'); 
[length1,width1]=size(original_data1);
[length2,width2]=size(original_data2);
%提取每一道高度和厚度信息

%z11=original_data2(:,13)+(6-1.713);
hou0=original_data1(:,2);
hou1=original_data1(:,4);
hou2=original_data1(:,6);
hou3=original_data1(:,8);
hou4=original_data1(:,10);
hou5=original_data2(:,2);
hou6=original_data2(:,4);
hou7=original_data2(:,6);
hou8=original_data2(:,8);
hou9=original_data2(:,10);
hou10=original_data2(:,12);


z0_0 = isfinite(zz0(:));z0_1  = zz0(z0_0);
z1_0 = isfinite(zz1(:));z1_1  = zz1(z1_0);
z2_0 = isfinite(zz2(:));z2_1  = zz2(z2_0);

z3_0 = isfinite(zz3(:));z3_1  = zz3(z3_0);
z4_0 = isfinite(zz4(:));z4_1  = zz4(z4_0);
z5_0 = isfinite(zz5(:));z5_1  = zz5(z5_0);

z6_0 = isfinite(zz6(:));z6_1  = zz6(z6_0);
z7_0 = isfinite(zz7(:));z7_1  = zz7(z7_0);
z8_0 = isfinite(zz8(:));z8_1  = zz8(z8_0);

z9_0 = isfinite(zz9(:));z9_1  = zz9(z9_0);
z10_0 = isfinite(zz10(:));z10_1  = zz10(z10_0);

r=6;%筒壁半径
v=1;
 for u01=0.5:0.5:2.5
     u1=u01*360/(2*3.14*r);
     x1(v)=r*cos(pi/(180/u1));
     y1(v)=r*sin(pi/(180/u1));
     v=v+1;
 end

 v2=1;
 for u02=-0.5:-0.5:-3
     u2=u02*360/(2*3.14*r);   
     x2(v2)=r*cos(pi/(180/u2));
     y2(v2)=r*sin(pi/(180/u2));
     
     v2=v2+1;
 end

X_ALL=[x1 x2];
Y_ALL=[y1 y2];

Z_NUM=[max(size(z0_1)) max(size(z1_1)) max(size(z2_1)) max(size(z3_1)) max(size(z4_1)) max(size(z5_1)) max(size(z6_1)) max(size(z7_1)) max(size(z8_1)) max(size(z9_1)) max(size(z10_1))];


for i=1:1:Z_NUM(1)
   Data_all(i,:)=[X_ALL(1) Y_ALL(1) zz0(i)  hou0(i)];
end

NUM_ILL=Z_NUM(1);
for i=1:1:Z_NUM(2)
   Data_all(NUM_ILL+i,:)=[X_ALL(2) Y_ALL(2) zz1(i)  hou1(i)];
end




NUM_ILL=NUM_ILL+Z_NUM(2);
for i=1:1:Z_NUM(3)
   Data_all(NUM_ILL+i,:)=[X_ALL(3) Y_ALL(3) zz2(i)  hou2(i)];
end

NUM_ILL=NUM_ILL+Z_NUM(3);
for i=1:1:Z_NUM(4)
   Data_all(NUM_ILL+i,:)=[X_ALL(4) Y_ALL(4) zz3(i)  hou3(i)];
end

NUM_ILL=NUM_ILL+Z_NUM(4);
for i=1:1:Z_NUM(5)
   Data_all(NUM_ILL+i,:)=[X_ALL(5) Y_ALL(5) zz4(i)  hou4(i)];
end

NUM_ILL=NUM_ILL+Z_NUM(5);
for i=1:1:Z_NUM(6)
   Data_all(NUM_ILL+i,:)=[X_ALL(6) Y_ALL(6) zz5(i)  hou5(i)];
end

NUM_ILL=NUM_ILL+Z_NUM(6);
for i=1:1:Z_NUM(7)
   Data_all(NUM_ILL+i,:)=[X_ALL(7) Y_ALL(7) zz6(i)  hou6(i)];
end

NUM_ILL=NUM_ILL+Z_NUM(7);
for i=1:1:Z_NUM(8)
   Data_all(NUM_ILL+i,:)=[X_ALL(8) Y_ALL(8) zz7(i)  hou7(i)];
end

NUM_ILL=NUM_ILL+Z_NUM(8);
for i=1:1:Z_NUM(9)
   Data_all(NUM_ILL+i,:)=[X_ALL(9) Y_ALL(9) zz8(i)  hou8(i)];
end

NUM_ILL=NUM_ILL+Z_NUM(9);
for i=1:1:Z_NUM(10)
   Data_all(NUM_ILL+i,:)=[X_ALL(10) Y_ALL(10) zz9(i)  hou9(i)];
end

NUM_ILL=NUM_ILL+Z_NUM(10);
for i=1:1:Z_NUM(11)
   Data_all(NUM_ILL+i,:)=[X_ALL(11) Y_ALL(11) zz10(i)  hou10(i)];
end

Val_min=round(min(Data_all(:,3))*100);
Val_max=round(max(Data_all(:,3))*100);

RR=6;
i=1;
for u01=1:1:600
 for   u02=1:1:3.14*200
X(i)=RR*cos(u02/100);
Y(i)=RR*sin(u02/100);
Z(i)=u01/100;
Cc(i)=0;
i=i+1;
 end
end
MMM=[X' Y' Z' Cc'];

Origin_ABCD=[Data_all(:,1:3)*1000  Data_all(:,4) ];
Origin_EFGH=MMM*1000;























