📄 current2voltage2.asv
字号:
function Vo=current2voltage2(u)
%==============================================
% 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)
%==============================================
%
%
if isempty(find_system(gcs,'Name','Fotodetector'))~=1
Current2Voltaje2=([gcs,'/','Fotodetector']);
Senal2=get_param(Current2Voltaje2,'sel');
Frecuencia2=get_param(Current2Voltaje2,'frec');
%==============================================
[c d]=size(u);
Vo2=zeros(c,d);
Prod=(max(u(:,:))+min(u(:,:)))/2;
switch (Frecuencia2)
case '1310'
switch (Senal2)
case 'STS-12/STM-4'
Ro2=60; %Las unidades de la resistencia son "Ohmios".
Ibias2=0.012;
case 'STS-48/STM-16'
Ro2=36.6666666667; %Las unidades de la resistencia son "Ohmios".
Ibias2=0.012;
otherwise
Ro2=43.3333333333; %Las unidades de la resistencia son "Ohmios".
Ibias2=0.011;
end
case '1550'
switch (Senal2)
case 'STS-12/STM-4'
Ro2=60; %Las unidades de la resistencia son "Ohmios".
Ibias2=0.012;
case 'STS-48/STM-16'
Ro2=31.4285714285; %Las unidades de la resistencia son "Ohmios".
Ibias2=0.012;
otherwise
Ro2=20; %Las unidades de la resistencia son "Ohmios".
Ibias2=0.02;
end
end
%%%%%%%%%%%%%%
for i=1:d
if (u(i)>=Prod);
Vo2(i)=(u(i)-Ibias2)*Ro2;
else
Vo2(i)=0;
end
end
%%%%%%%%%%%%%%
Vo=Vo2(:,:);
end
if isempty(find_system(gcs,'Name','Fotodetector1'))~=1
Current2Voltaje211=([gcs,'/','Fotodetector1']);
Senal211=get_param(Current2Voltaje211,'sel');
Frecuencia211=get_param(Current2Voltaje211,'frec');
%==============================================
[c d]=size(u);
Vo211=zeros(c,d);
Pro11=(max(u(:,:))+min(u(:,:)))/2;
switch (Frecuencia211)
case '1310'
switch (Senal211)
case 'STS-12/STM-4'
Ro211=60; %Las unidades de la resistencia son "Ohmios".
Ibias211=0.012;
case 'STS-48/STM-16'
Ro211=36.6666666667; %Las unidades de la resistencia son "Ohmios".
Ibias211=0.012;
otherwise
Ro211=43.3333333333; %Las unidades de la resistencia son "Ohmios".
Ibias211=0.011;
end
case '1550'
switch (Senal211)
case 'STS-12/STM-4'
Ro211=60; %Las unidades de la resistencia son "Ohmios".
Ibias211=0.012;
case 'STS-48/STM-16'
Ro211=31.4285714285; %Las unidades de la resistencia son "Ohmios".
Ibias211=0.012;
otherwise
Ro211=20; %Las unidades de la resistencia son "Ohmios".
Ibias211=0.02;
end
end
%%%%%%%%%%%%%%
for i=1:d
if (u(i)>=Pro11);
Vo211(i)=(u(i)-Ibias211)*Ro211;
else
Vo211(i)=0;
end
end
%%%%%%%%%%%%%%
Vo=Vo211(:,:);
end
if isempty(find_system(gcs,'Name','Fotodetector2'))~=1
Current2Voltaje222=([gcs,'/','Fotodetector2']);
Senal222=get_param(Current2Voltaje222,'sel');
Frecuencia222=get_param(Current2Voltaje222,'frec');
%==============================================
[c d]=size(u);
Vo222=zeros(c,d);
Pro22=(max(u(:,:))+min(u(:,:)))/2;
switch (Frecuencia222)
case '1310'
switch (Senal222)
case 'STS-12/STM-4'
Ro222=60; %Las unidades de la resistencia son "Ohmios".
Ibias222=0.012;
case 'STS-48/STM-16'
Ro222=36.6666666667; %Las unidades de la resistencia son "Ohmios".
Ibias222=0.012;
otherwise
Ro222=43.3333333333; %Las unidades de la resistencia son "Ohmios".
Ibias222=0.011;
end
case '1550'
switch (Senal222)
case 'STS-12/STM-4'
Ro222=60; %Las unidades de la resistencia son "Ohmios".
Ibias222=0.012;
case 'STS-48/STM-16'
Ro222=31.4285714285; %Las unidades de la resistencia son "Ohmios".
Ibias222=0.012;
otherwise
Ro222=20; %Las unidades de la resistencia son "Ohmios".
Ibias222=0.02;
end
end
%%%%%%%%%%%%%%
for i=1:d
if (u(i)>=Pro22);
Vo222(i)=(u(i)-Ibias222)*Ro222;
else
Vo222(i)=0;
end
end
%%%%%%%%%%%%%%
Vo=Vo222(:,:);
end
if isempty(find_system(gcs,'Name','Fotodetector3'))~=1
Current2Voltaje233=([gcs,'/','Fotodetector3']);
Senal233=get_param(Current2Voltaje233,'sel');
Frecuencia233=get_param(Current2Voltaje233,'frec');
%==============================================
[c d]=size(u);
Vo233=zeros(c,d);
Pro33=(max(u(:,:))+min(u(:,:)))/2;
switch (Frecuencia233)
case '1310'
switch (Senal233)
case 'STS-12/STM-4'
Ro233=60; %Las unidades de la resistencia son "Ohmios".
Ibias233=0.012;
case 'STS-48/STM-16'
Ro233=36.6666666667; %Las unidades de la resistencia son "Ohmios".
Ibias233=0.012;
otherwise
Ro233=43.3333333333; %Las unidades de la resistencia son "Ohmios".
Ibias233=0.011;
end
case '1550'
switch (Senal233)
case 'STS-12/STM-4'
Ro233=60; %Las unidades de la resistencia son "Ohmios".
Ibias233=0.012;
case 'STS-48/STM-16'
Ro233=31.4285714285; %Las unidades de la resistencia son "Ohmios".
Ibias233=0.012;
otherwise
Ro233=20; %Las unidades de la resistencia son "Ohmios".
Ibias233=0.02;
end
end
%%%%%%%%%%%%%%
for i=1:d
if (u(i)>=Pro33);
Vo233(i)=(u(i)-Ibias233)*Ro233;
else
Vo233(i)=0;
end
end
%%%%%%%%%%%%%%
Vo=Vo233(:,:);
end
if isempty(find_system(gcs,'Name','Fotodetector4'))~=1
Current2Voltaje244=([gcs,'/','Fotodetector4']);
Senal244=get_param(Current2Voltaje244,'sel');
Frecuencia244=get_param(Current2Voltaje244,'frec');
%==============================================
[c d]=size(u);
Vo244=zeros(c,d);
Pro44=(max(u(:,:))+min(u(:,:)))/2;
switch (Frecuencia244)
case '1310'
switch (Senal244)
case 'STS-12/STM-4'
Ro244=60; %Las unidades de la resistencia son "Ohmios".
Ibias244=0.012;
case 'STS-48/STM-16'
Ro244=36.6666666667; %Las unidades de la resistencia son "Ohmios".
Ibias244=0.012;
otherwise
Ro244=43.3333333333; %Las unidades de la resistencia son "Ohmios".
Ibias244=0.011;
end
case '1550'
switch (Senal244)
case 'STS-12/STM-4'
Ro244=60; %Las unidades de la resistencia son "Ohmios".
Ibias244=0.012;
case 'STS-48/STM-16'
Ro244=31.4285714285; %Las unidades de la resistencia son "Ohmios".
Ibias244=0.012;
otherwise
Ro244=20; %Las unidades de la resistencia son "Ohmios".
Ibias244=0.02;
end
end
%%%%%%%%%%%%%%
for i=1:d
if (Io(i)>=Pro44);
Vo244(i)=(u(i)-Ibias244)*Ro244;
else
Vo244(i)=0;
end
end
%%%%%%%%%%%%%%
Vo=Vo244(:,:);
end
if isempty(find_system(gcs,'Name','Fotodetector5'))~=1
Current2Voltaje255=([gcs,'/','Fotodetector5']);
Senal255=get_param(Current2Voltaje255,'sel');
Frecuencia255=get_param(Current2Voltaje255,'frec');
%==============================================
[c d]=size(u);
Vo255=zeros(c,d);
Pro55=(max(u(:,:))+min(u(:,:)))/2;
switch (Frecuencia255)
case '1310'
switch (Senal255)
case 'STS-12/STM-4'
Ro255=60; %Las unidades de la resistencia son "Ohmios".
Ibias255=0.012;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -