MATLAB 绘图

 

matlab直接保存图形而不显示图形_matlab直接保存图片不显示_faith默默的博客-CSDN博客

 

Matlab中图片保存的四种方法 - 技术蛀虫 - 博客园 (cnblogs.com)

 

暴力参数遍历

clear all
tic
N_L = 10; N_M = 10; N_N = 10;
L1 = linspace(-5.28,-6.98,N_L);
M1 = linspace(-1.25,-3.26,N_M);
N1 = linspace(-6.26,-8.00,N_N);
tmp = zeros(N_L*N_M*N_N,3);
index = 1;
for i_L = 1:N_L
    for i_M = 1:N_M
        for i_N = 1:N_N
            tmp(index,:) = [L1(i_L);M1(i_M);N1(i_N)];
            index = index + 1;
        end
    end
end

%%%%%%%%%%%%%%%%%%%%%%%%%% Reference Data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
load SiNW1_3nm_vogl_valence.mat
kpoints_ref = kpoints(601:1200,:);
energies = energies(563:576,:); % 573£º576
energies = energies'; 
energies_ref = energies(601:1200,:);


for i = 1:N_L*N_M*N_N
    
    L = tmp(i,1);
    M = tmp(i,2);
    N = tmp(i,3);

h = figure(1);
set(h,'visible','off')
%figure('visible','off')
kpath = kpoints2kpath(kpoints_ref);
plot(kpath,energies_ref,'k');
ylim([-2,-0.5]);


%%%%%%%%%%%%%%%%%%%%%%%%%% Initial Parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
kpoints = generate_k([0,0,0],[0,0,3.1415916/3], 61);

% L = -5.53;M = -3.64;N = -8.32;
% L = -5.88; M = -2.16; N = -7.26;
E0 = -0.562259615;

params = [L,M,N,E0];
energies = nanowires_valence(params,kpoints);

kpath = kpoints2kpath(kpoints);
%figure;
hold on
%figure('visible','off')
plot(kpath,energies,'r');
ylim([-2,-0.5]);
title(['L:', num2str(L),' M:', num2str(M),' N:', num2str(N)])

filename = [num2str(i),'_',num2str(L),'_',num2str(M),'_',num2str(N),'.png'];
%print(gcf,'-dpng','abc.png')  
saveas(gcf, filename)
close all


end
toc

  

posted @ 2023-05-19 19:41  ghzphy  阅读(56)  评论(0编辑  收藏  举报