%table to plot conversion, multiple dimensions and singularity degree

sd1pfeas = [3.17e-12 7.28e-12 9.12e-12 1.26e-11];
sd1cs = [1.26e-13 2.95e-13 3.65e-13 5.20e-13];
sd2pfeas = [4.99e-12 8.4e-12 1.92e-11 9.84e-12];
sd2cs = [2.04e-13 2.73e-13 6.46e-13 3.52e-13];
ns = [50 80 110 140];

figure(1)
clf
hold on
plot(ns,log10(sd1pfeas),'.','MarkerSize',25,'Color','k')
plot(ns,log10(sd2pfeas),'x','MarkerSize',10,'Color','k')
leg1 = legend('${\rm sd}(\mathcal{F})=1$','${\rm sd}(\mathcal{F})>1$','location','best');
set(leg1,'Interpreter','latex');
set(leg1,'FontSize',20);
title('Feasibility vs. Dimension','Interpreter','latex','FontSize',20);
xlabel('$n$','Interpreter','latex','FontSize',20);
ylabel('$\log_{10}({\rm dist}(\tilde{X},(\mathcal{A},b)))$','Interpreter','latex','FontSize',20);
hold off

figure(2)
clf
hold on
plot(ns,log10(sd1cs),'.','MarkerSize',25,'Color','k')
plot(ns,log10(sd2cs),'x','MarkerSize',10,'Color','k')
leg1 = legend('${\rm sd}(\mathcal{F})=1$','${\rm sd}(\mathcal{F})>1$','location','best');
set(leg1,'Interpreter','latex');
set(leg1,'FontSize',20);
title('Complementary Slackness vs. Dimension','Interpreter','latex','FontSize',20);
xlabel('$n$','Interpreter','latex','FontSize',20);
ylabel('$\log_{10}(\langle \tilde{X},\tilde{Z}\rangle)$','Interpreter','latex','FontSize',20);
hold off
