Demo entry 6760834

111

   

Submitted by 11 on Sep 18, 2018 at 15:44
Language: Matlab. Code size: 1.8 kB.

clear all;
l=36;len=492;

[N_anser,E_anser,A_anser,g_anser]=shuru();

[mfc,~]=size(A_anser);

[N_linear,E_linear]=linearsolution(l,len);

[A_linear,g_linear]=AGfinder(E_anser,A_anser,g_anser,E_linear,l,mfc,len);

Agg=zeros(1,len);ggg=zeros(1,len);
for i=1:1:l
    for j=1:1:mfc
        N=N_linear(i,:);
        for x=1:1:len
            Agg(x)=A_linear(i,j,x)*cos(g_linear(i,j,x));
            ggg(x)=A_linear(i,j,x)*sin(g_linear(i,j,x));
        end
        [Ai,Ari]=supermulititwo(N,Agg);
        [gi,gri]=supermulititwo(N,ggg);
        for x=1:1:length(Ai)
            A(i,j,x)=Ai(x);
        end
        for x=1:1:length(Ari)
            Ar(i,j,x)=Ari(x);
        end
        for x=1:1:length(gi)
            g(i,j,x)=gi(x);
        end
        for x=1:1:length(gri)
            gr(i,j,x)=gri(x);
        end
    end
end
AGG=zeros(1,len);gGG=zeros(1,len);NGG=zeros(1,len);ArGG=zeros(1,len);grGG=zeros(1,len);
for i=1:1:l
    for j=1:1:mfc
        AGG=A(i,j,:);
        AGG(AGG==0)=[];
        gGG=g(i,j,:);
        gGG(gGG==0)=[];
        NGG=N_linear(i,:);
        NGG(NGG==0)=[];
        ArGG=Ar(i,j,:);
        ArGG(ArGG==0)=[];
        grGG=gr(i,j,:);
        grGG(grGG==0)=[];
        figure(i)
        subplot(mfc,2,j)
        plot(NGG,AGG,'-b',NGG,ArGG,'-r');
        xlabel('¾­¶È');
        ylabel('Õñ·ù');
        title('Õñ·ù¼°Æä²ÐÖµ');
        legend('Õñ·ù','²ÐÖµ');
        subplot(mfc,2,j+1)
        plot(NGG,gGG,'-b',NGG,grGG,'-r');
        xlabel('¾­¶È');
        ylabel('³Ù½Ç');
        title('³Ù½Ç¼°Æä²ÐÖµ');
        legend('³Ù½Ç','²ÐÖµ');
        filename=struct('D:\ROY\SXJM\SXJM\solution\picture\line',num2str(i),'.png');
        h=getframe(gcf);
        imwrite(h.cdata,filename);
    end
end

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).