figure(1);
subplot(2, 4, 1); hold on;
grid on;
title('Device-Device Variability (128x128)', fontsize=12.5);
data = readtable('1_AE.csv');
data = data(1:25,:);
x = table2array(data(:, 2));
y = table2array(data(:, 3));
z = table2array(data(:, 4));
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);
trisurf(tri,xi,yi,zi);
xlim([2, 10]);
xticks(2:2:10);
ylim([1e6, 1e7]);
yticks(1e6:2e6:1e7);
zlim([10, 100]);
zticks(10:30:100);
set(gca, 'Xdir', 'reverse')
set(gca, 'Ydir', 'reverse')
xlabel('ADC Resolution (bits)', fontsize=12);
ylabel('\sigma', fontsize=12);
zlabel('Test Set Accuracy (%)', fontsize=12);
view([45, 45]);
subplot(2, 4, 2); hold on;
grid on;
title('Finite Conductance States (128x128)', fontsize=12.5);
data = readtable('1_BF.csv');
data = data(1:25,:);
x = table2array(data(:, 2));
y = table2array(data(:, 3));
z = table2array(data(:, 4));
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);
trisurf(tri,xi,yi,zi);
xlim([2, 10]);
xticks(2:2:10);
ylim([2, 10]);
yticks(2:2:10);
zlim([10, 100]);
zticks(10:30:100);
set(gca, 'Xdir', 'reverse')
set(gca, 'Ydir', 'reverse')
xlabel('ADC Resolution (bits)', fontsize=12);
ylabel('Conductance States', fontsize=12);
zlabel('Test Set Accuracy (%)', fontsize=12);
view([45, 45]);
subplot(2, 4, 3); hold on;
grid on;
title('Device Failure Towards R_{ON} (128x128)', fontsize=12.5);
data = readtable('1_CG.csv');
data = data(1:25,:);
x = table2array(data(:, 2));
y = table2array(data(:, 3)) * 100;
z = table2array(data(:, 4));
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);
trisurf(tri,xi,yi,zi);
xlim([2, 10]);
xticks(2:2:10);
ylim([0, 25]);
yticks(0:5:25);
zlim([10, 100]);
zticks(10:30:100);
set(gca, 'Xdir', 'reverse')
set(gca, 'Ydir', 'reverse')
xlabel('ADC Resolution (bits)', fontsize=12);
ylabel('Failure Percentage (%)', fontsize=12);
zlabel('Test Set Accuracy (%)', fontsize=12);
view([45, 45]);
subplot(2, 4, 4); hold on;
grid on;
title('Device Failure Towards R_{OFF} (128x128)', fontsize=12.5);
data = readtable('1_DH.csv');
data = data(1:25,:);
x = table2array(data(:, 2));
y = table2array(data(:, 3)) * 100;
z = table2array(data(:, 4));
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);
trisurf(tri,xi,yi,zi);
xlim([2, 10]);
xticks(2:2:10);
ylim([0, 25]);
yticks(0:5:25);
zlim([40, 100]);
zticks(40:20:100);
set(gca, 'Xdir', 'reverse')
set(gca, 'Ydir', 'reverse')
xlabel('ADC Resolution (bits)', fontsize=12);
ylabel('Failure Percentage (%)', fontsize=12);
zlabel('Test Set Accuracy (%)', fontsize=12);
view([45, 45]);
subplot(2, 4, 5); hold on;
grid on;
title('Device-Device Variability (256x64)', fontsize=12.5);
data = readtable('1_AE.csv');
data = data(26:end,:);
x = table2array(data(:, 2));
y = table2array(data(:, 3));
z = table2array(data(:, 4));
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);
trisurf(tri,xi,yi,zi);
xlim([2, 10]);
xticks(2:2:10);
ylim([1e6, 1e7]);
yticks(1e6:2e6:1e7);
zlim([10, 100]);
zticks(10:30:100);
set(gca, 'Xdir', 'reverse')
set(gca, 'Ydir', 'reverse')
xlabel('ADC Resolution (bits)', fontsize=12);
ylabel('\sigma', fontsize=12);
zlabel('Test Set Accuracy (%)', fontsize=12);
view([45, 45]);
subplot(2, 4, 6); hold on;
grid on;
title('Finite Conductance States (256x64)', fontsize=12.5);
data = readtable('1_BF.csv');
data = data(26:end,:);
x = table2array(data(:, 2));
y = table2array(data(:, 3));
z = table2array(data(:, 4));
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);
trisurf(tri,xi,yi,zi);
xlim([2, 10]);
xticks(2:2:10);
ylim([2, 10]);
yticks(2:2:10);
zlim([10, 100]);
zticks(10:30:100);
set(gca, 'Xdir', 'reverse')
set(gca, 'Ydir', 'reverse')
xlabel('ADC Resolution (bits)', fontsize=12);
ylabel('Conductance States', fontsize=12);
zlabel('Test Set Accuracy (%)', fontsize=12);
view([45, 45]);
subplot(2, 4, 7); hold on;
grid on;
title('Device Failure Towards R_{ON} (256x64)', fontsize=12.5);
data = readtable('1_CG.csv');
data = data(26:end,:);
x = table2array(data(:, 2));
y = table2array(data(:, 3)) * 100;
z = table2array(data(:, 4));
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);
trisurf(tri,xi,yi,zi);
xlim([2, 10]);
xticks(2:2:10);
ylim([0, 25]);
yticks(0:5:25);
zlim([10, 100]);
zticks(10:30:100);
set(gca, 'Xdir', 'reverse')
set(gca, 'Ydir', 'reverse')
xlabel('ADC Resolution (bits)', fontsize=12);
ylabel('Failure Percentage (%)', fontsize=12);
zlabel('Test Set Accuracy (%)', fontsize=12);
view([45, 45]);
subplot(2, 4, 8); hold on;
grid on;
title('Device Failure Towards R_{OFF} (256x64)', fontsize=12.5);
data = readtable('1_DH.csv');
data = data(26:end,:);
x = table2array(data(:, 2));
y = table2array(data(:, 3)) * 100;
z = table2array(data(:, 4));
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);
trisurf(tri,xi,yi,zi);
xlim([2, 10]);
xticks(2:2:10);
ylim([0, 25]);
yticks(0:5:25);
zlim([40, 100]);
zticks(40:20:100);
set(gca, 'Xdir', 'reverse')
set(gca, 'Ydir', 'reverse')
xlabel('ADC Resolution (bits)', fontsize=12);
ylabel('Failure Percentage (%)', fontsize=12);
zlabel('Test Set Accuracy (%)', fontsize=12);
view([45, 45]);
set(gcf,'units','points','position',[10,10,1400,525])