current2voltage.m

来自「matlab在通信原理中的应用」· M 代码 · 共 96 行

M
96
字号
function Vo=current2voltage(Io)
%==============================================
% current2voltage= Esta funcion permite transformar el valor de la corriente de entrada
% a voltage.
%==============================================
%
%	AUTORES : Z. AGUI%O & D. STECKLER
%                       Universidad de Carabobo
%                       Valencia edo. Carabobo, VENEZUELA
%
%	FECHA     : Diciembre 2003
%	VERSION : 1.0
%
%==============================================
%	Realizado bajo MATLAB 6.5 Release 13/ Diciemdre 2003 (DZ)
%==============================================
%
%
[c d]=size(Io);
Ro=0;
Vol=zeros(c,d);
%
i=1; band=0;

    while i<=50
        if isempty(find_system(gcs,'Name','Laser'))==1
            
            if isempty(find_system(gcs,'Name',['Laser',int2str(i)]))==1
                band=2;% No Encontrado
            else
                band=3; %Encontrado
                blk=([gcs,'/','Laser',int2str(i)]);
                S=get_param(blk,'sel');
                T=get_param(blk,'frec');
                break
            end
            
        else
            
            band=4;  %Encontrado
            blk=([gcs,'/','Laser']);
            S=get_param(blk,'sel');
            T=get_param(blk,'frec');
            break
            
        end
        i=i+1
    end
%
%
%
%==============================================
switch (Frecuencia)
    case '1310'
        switch (Senal)
            case 'STS-12/STM-4'
                Ro=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias=0.012;
            case 'STS-48/STM-16'
                Ro=36.6666666667;  %Las unidades de la resistencia son "Ohmios".
                Ibias=0.012;
            otherwise
                Ro=43.3333333333;  %Las unidades de la resistencia son "Ohmios".
                Ibias=0.011;
        end
        
    case '1550'
        switch (Senal)
            case 'STS-12/STM-4'
                Ro=60;  %Las unidades de la resistencia son "Ohmios".
                Ibias=0.012;
            case 'STS-48/STM-16'
                Ro=31.4285714285;  %Las unidades de la resistencia son "Ohmios".
                Ibias=0.012;
            otherwise
                R=20;  %Las unidades de la resistencia son "Ohmios".
                Ibias=0.02;
        end
end

%%%%%%%%%%%%%%
for i=1:d
    if (Io(i)>=Ibias);
        Vol(i)=(Io(i)-Ibias)*Ro;
    else (Io(i)==Ibias);
        Vol(i)=0;
    end
end
%%%%%%%%%%%%%%
        
end

Vo=Vol(:,:);

end
% [EOF] current2voltage.m

⌨️ 快捷键说明

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