clear all
close all
w = 50;
h = 70;
b = 10;

t0 = csvread(['b',num2str(b),'w',num2str(w),'h',num2str(h),'.csv'],1,0);

x = t0(:,1);
y = t0(:,2);
alpha = t0(:,7);
index = find(y>b*1.00001*1e-6);
x_c = x(index);
y_c = y(index);
alpha_c = alpha(index);
x_u = unique(x_c);
y_u = unique(y_c);
dx = x_u(4)-x_u(3);
dy = y_u(4)-y_u(3);
index_trap = find(alpha_c<0.5);
trap_per = length(index_trap)*dx*dy/(h*1e-6*w*1e-6)