sin1.m

来自「对于天线的设计和应用进行了仿真,并进行了优化处理」· M 代码 · 共 61 行

M
61
字号
Pr=0.8;
Pm=0.004;
N=7;
Len=10;
Lenth=N*Len;

% Phi=zeros(M,Lenth);
% BestValue=zeros(1,T);
% Generater the first generation of the population
%Chro=round(rand(M,Lenth));
% Phi=DecodeChro(Chro,M,Lenth,N,Len);
% Phi=pi*Phi/2046;
Phi1=[0.4284,0.4022,0.7155,1.080,1.2944,1.5678,1.2268];
Phi2=[1.2,0.77,1.33,1.03,0.85,0.284,0.932];

dr=0.8;
k=2*pi*dr;
s=0;
max=0;
Value=ones(1,201);
    for f=-1:0.01:1
        s=s+1;
        for n=1:N
            Value(1,s)=Value(1,s)+exp(i*(k*f*n+Phi2(n)));
        end
        Value(1,s)=abs(Value(1,s));
        if max<Value(1,s)
            max=Value(1,s);
        end
    end
 
    f=-1:0.01:1;
    subplot(2,2,1); plot(f,Value),grid;
    Value=Value./max;
    Value=20*log10(Value);
    
   subplot(2,2,2);  plot(f,Value),grid;

     
dr=0.8;
k=2*pi*dr;
s=0;
a=pi/16;
Value=ones(1,201);
    for f=-1:0.01:1
        s=s+1;
        for n=1:N
            Value(1,s)=Value(1,s)+exp(i*(k*f*n+n*a));
        end
        Value(1,s)=abs(Value(1,s));
        if max<Value(1,s)
            max=Value(1,s);
        end
    end

    f=-1:0.01:1;
        subplot(2,2,3); plot(f,Value),grid;
        Value=Value./max;
         Value=20*log10(Value);
         
         subplot(2,2,4); plot(f,Value),grid;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?