rc = gen_rc(4);
for max_pot = [0,0.01,0.1,1,4,16,64]
    % This is to create bernoulli random potential
    pot = max_pot*binornd(ones(1,9^3),0.2);
    
    % This is to get the hamiltonian
    lap = rc_lap(4,rc,pot);
    
    % Solve eigenvalue problem
    [v,l] = eigsolver(lap,55);

    % Plot
    for j = [1:10,21:30,51:55]
        rcplot3(v(:,j),rc,strcat('RC eigenfunction of \lambda=',num2str(l(j))));
        fname = strcat(num2str(max_pot),'_',num2str(j),'.png');
        saveas(gcf,fname,'png');
        clf;    
    end

   
    % Eigenvalue counting function
    l = eigsolver(lap,250);
    eig_count(l);
    saveas(gcf,strcat('spec_',num2str(max_pot),'.png'),'png')
    clf;
end

