current2voltage3.asv

来自「Matlab实现SONET/SDH光通信系统simulink仿真程序源代码」· ASV 代码 · 共 456 行 · 第 1/2 页

ASV
456
字号
        switch (Senal55f)
            case 'STS-12/STM-4'
                Ro55f=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias55f=0.012;
            case 'STS-48/STM-16'
                Ro55f=36.6666666667;  %Las unidades de la resistencia son "Ohmios".
                Ibias55f=0.012;
            otherwise
                Ro55f=43.3333333333;  %Las unidades de la resistencia son "Ohmios".
                Ibias55f=0.011;
        end
        
    case '1550'
        switch (Senal55f)
            case 'STS-12/STM-4'
                Ro55f=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias55f=0.012;
            case 'STS-48/STM-16'
                Ro55f=31.4285714285;  %Las unidades de la resistencia son "Ohmios".
                Ibias55f=0.012;
            otherwise
                Ro55f=20;  %Las unidades de la resistencia son "Ohmios".
                Ibias55f=0.02;
        end
end
set_param(Current2Voltaje55f,'Ibiasf',num2str(Ibias55f));
set_param(Current2Voltaje55f,'Rof',num2str(Ro55f));
end


if isempty(find_system(gcs,'Name','Fotodetector6'))~=1
    
    Current2Voltaje66f=([gcs,'/','Fotodetector6']);
    Senal66f=get_param(Current2Voltaje66f,'sel');
    Frecuencia66f=get_param(Current2Voltaje66f,'frec');
    
%==============================================

switch (Frecuencia66f)
    case '1310'
        switch (Senal66f)
            case 'STS-12/STM-4'
                Ro66f=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias66f=0.012;
            case 'STS-48/STM-16'
                Ro66f=36.6666666667;  %Las unidades de la resistencia son "Ohmios".
                Ibias66f=0.012;
            otherwise
                Ro66f=43.3333333333;  %Las unidades de la resistencia son "Ohmios".
                Ibias66f=0.011;
        end
        
    case '1550'
        switch (Senal66f)
            case 'STS-12/STM-4'
                Ro66f=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias66f=0.012;
            case 'STS-48/STM-16'
                Ro66f=31.4285714285;  %Las unidades de la resistencia son "Ohmios".
                Ibias66f=0.012;
            otherwise
                Ro66f=20;  %Las unidades de la resistencia son "Ohmios".
                Ibias66f=0.02;
        end
end
set_param(Current2Voltaje66f,'Ibiasf',num2str(Ibias66f));
set_param(Current2Voltaje66f,'Rof',num2str(Ro66f));
end


if isempty(find_system(gcs,'Name','Fotodetector7'))~=1
    
    Current2Voltaje77f=([gcs,'/','Fotodetector7']);
    Senal77f=get_param(Current2Voltaje77f,'sel');
    Frecuencia77f=get_param(Current2Voltaje77f,'frec');
    
%==============================================

switch (Frecuencia77f)
    case '1310'
        switch (Senal77f)
            case 'STS-12/STM-4'
                Ro77f=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias77f=0.012;
            case 'STS-48/STM-16'
                Ro77f=36.6666666667;  %Las unidades de la resistencia son "Ohmios".
                Ibias77f=0.012;
            otherwise
                Ro77f=43.3333333333;  %Las unidades de la resistencia son "Ohmios".
                Ibias77f=0.011;
        end
        
    case '1550'
        switch (Senal77f)
            case 'STS-12/STM-4'
                Ro77f=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias77f=0.012;
            case 'STS-48/STM-16'
                Ro77f=31.4285714285;  %Las unidades de la resistencia son "Ohmios".
                Ibias77f=0.012;
            otherwise
                Ro77f=20;  %Las unidades de la resistencia son "Ohmios".
                Ibias77f=0.02;
        end
end
set_param(Current2Voltaje77f,'Ibiasf',num2str(Ibias77f));
set_param(Current2Voltaje77f,'Rof',num2str(Ro77f));
end

if isempty(find_system(gcs,'Name','Fotodetector8'))~=1
    
    Current2Voltaje88f=([gcs,'/','Fotodetector8']);
    Senal88f=get_param(Current2Voltaje88f,'sel');
    Frecuencia88f=get_param(Current2Voltaje88f,'frec');
    
%==============================================

switch (Frecuencia88f)
    case '1310'
        switch (Senal88f)
            case 'STS-12/STM-4'
                Ro88f=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias88f=0.012;
            case 'STS-48/STM-16'
                Ro88f=36.6666666667;  %Las unidades de la resistencia son "Ohmios".
                Ibias88f=0.012;
            otherwise
                Ro88f=43.3333333333;  %Las unidades de la resistencia son "Ohmios".
                Ibias88f=0.011;
        end
        
    case '1550'
        switch (Senal88f)
            case 'STS-12/STM-4'
                Ro88f=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias88f=0.012;
            case 'STS-48/STM-16'
                Ro88f=31.4285714285;  %Las unidades de la resistencia son "Ohmios".
                Ibias88f=0.012;
            otherwise
                Ro88f=20;  %Las unidades de la resistencia son "Ohmios".
                Ibias88f=0.02;
        end
end
set_param(Current2Voltaje88f,'Ibiasf',num2str(Ibias88f));
set_param(Current2Voltaje88f,'Rof',num2str(Ro88f));
end

if isempty(find_system(gcs,'Name','Fotodetector9'))~=1
    
    Current2Voltaje99f=([gcs,'/','Fotodetector9']);
    Senal99f=get_param(Current2Voltaje99f,'sel');
    Frecuencia99f=get_param(Current2Voltaje99f,'frec');
    
%==============================================

switch (Frecuencia99)
    case '1310'
        switch (Senal99)
            case 'STS-12/STM-4'
                Ro99=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias99=0.012;
            case 'STS-48/STM-16'
                Ro99=36.6666666667;  %Las unidades de la resistencia son "Ohmios".
                Ibias99=0.012;
            otherwise
                Ro99=43.3333333333;  %Las unidades de la resistencia son "Ohmios".
                Ibias99=0.011;
        end
        
    case '1550'
        switch (Senal99)
            case 'STS-12/STM-4'
                Ro99=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias99=0.012;
            case 'STS-48/STM-16'
                Ro99=31.4285714285;  %Las unidades de la resistencia son "Ohmios".
                Ibias99=0.012;
            otherwise
                Ro99=20;  %Las unidades de la resistencia son "Ohmios".
                Ibias99=0.02;
        end
end
set_param(Current2Voltaje99,'Ibiasf',num2str(Ibias99));
set_param(Current2Voltaje99,'Rof',num2str(Ro99));
end

if isempty(find_system(gcs,'Name','Fotodetector10'))~=1
    
    Current2Voltaje100=([gcs,'/','Fotodetector10']);
    Senal100=get_param(Current2Voltaje100,'sel');
    Frecuencia100=get_param(Current2Voltaje100,'frec');
    
%==============================================

switch (Frecuencia100)
    case '1310'
        switch (Senal100)
            case 'STS-12/STM-4'
                Ro100=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias100=0.012;
            case 'STS-48/STM-16'
                Ro100=36.6666666667;  %Las unidades de la resistencia son "Ohmios".
                Ibias100=0.012;
            otherwise
                Ro100=43.3333333333;  %Las unidades de la resistencia son "Ohmios".
                Ibias100=0.011;
        end
        
    case '1550'
        switch (Senal100)
            case 'STS-12/STM-4'
                Ro100=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias100=0.012;
            case 'STS-48/STM-16'
                Ro100=31.4285714285;  %Las unidades de la resistencia son "Ohmios".
                Ibias100=0.012;
            otherwise
                Ro100=20;  %Las unidades de la resistencia son "Ohmios".
                Ibias100=0.02;
        end
end
set_param(Current2Voltaje100,'Ibiasf',num2str(Ibias100));
set_param(Current2Voltaje100,'Rof',num2str(Ro100));
end
Vo(:,:)=u(:,:);
end
%[EOF] current2voltage.m

⌨️ 快捷键说明

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