Académique Documents
Professionnel Documents
Culture Documents
CORRIENTE
Integrantes:
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = Corriente_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
y2=((x>0)&(x<pi*f/2)).*(2*fm*x/(pi*f))+((x>pi*f/2)&(x<1.5*pi*f)).*(2*fm-
2*fm*x/(pi*f))+((x>pi*f*1.5)&(x<2*pi*f)).*(2*fm*x/(pi*f)-4*fm);
axes(handles.axes1);
plot(x,y2);
end
v2=get(handles.popupmenu2,'Value');
switch v2 %acá empieza
case 1 % Culebrita
y3=((x1>-0.2*lm/n)&(x1<lm/n)).*(fm*(1-exp(-
4*(x1+0.2*(lm/2)))))+((x1>-lm/n)&(x1<-0.2*lm/n)).*(fm*(-
1+exp(4*(x1+0.2*(lm/2)))));
axes(handles.axes2);
plot(x1,y3);
hold on
y9=((x1>0.2*lm/n)&(x1<lm/n)).*(fm*(1-exp(-4*(x1-
0.2*(lm/2)))))+((x1>-lm/n)&(x1<0.2*lm/n)).*(fm*(-1+exp(4*(x1-
0.2*(lm/2)))));
plot(x1,y9);
hold off
switch v
case 1 %Seno
y7=((x>0)&(x<pi*f/2)).*(-((log(1-sin(x/f)))-
0.2*lm/n)/4)+((x>pi*f/2)&(x<pi*f)).*(-((log(1-
sin(x/f)))+0.2*lm/n)/4)+((x>pi*f)&(x<3*pi*f/2)).*(((log(1+sin(x/f)))+0.2*
lm/n)/4)+((x>3*pi*f/2)&(x<2*pi)).*(((log(1+sin(x/f)))-
0.2*lm/n)/4)+((x>(3/2)*pi*f)&(x<2*pi*f)).*(1/4*((log(1+sin(x/f)))-
0.2*lm/n));
axes(handles.axes3);
plot(x,y7);
case 2 %triangulo
y8=((x>0)&(x<pi*f/2)).*(((((2*fm)/(n*fm))*x-
fm)*lm)/(n*fm))-((x>f*pi/2)&(x<pi*f)).*(((2*fm-(((2*fm)/(n*fm))*x)-
fm)*lm)/(n*fm))+((x>pi*f)&(x<3*pi*f/2)).*(((2*fm-(((2*fm)/(n*fm))*x)-
fm)*lm)/(n*fm))-((x>(3/2)*pi)&(x<2*pi*f)).*(((-
4*fm+(((2*fm)/(n*fm))*x)+fm)*lm)/(n*fm));
axes(handles.axes3);
plot(x,y8);
end
case 2 %rombo
y4=((x1>-lm/n)&(x1<0)).*((n*fm*x1/lm)+fm)+((x1>0)&(x1<lm/n)).*((-
n*fm*x1/lm)+fm);
y5=((x1>-lm/n)&(x1<0)).*((-n*fm*x1/lm)-
fm)+((x1>0)&(x1<lm/n)).*((n*fm*x1/lm)-fm);
axes(handles.axes2);
plot(x1,y4);
hold on
plot(x1,y5);
hold off
switch v
case 1 %seno
y7=((x>0)&(x<pi*f/2)).*(((fm*(sin(x/f))-fm)*lm)/(n*fm))-
((x>pi*f/2)&(x<pi*f)).*(((fm*(sin(x/f))-
fm)*lm)/(n*fm))+((x>pi*f)&(x<3*pi*f/2)).*(((fm*(sin(x/f))+fm)*lm)/(n*fm))
-((x>3*pi*f/2)&(x<2*pi)).*(((fm*(sin(x/f))-fm)*lm)/(n*fm))-
((x>(3/2)*pi*f)&(x<2*pi*f)).*(((fm*(sin(x/f))+fm)*lm)/(n*fm));
axes(handles.axes3);
plot(x,y7);
case 2 %triangulo
y8=x;
axes(handles.axes3);
plot(x,y8);
end
case 3 %linea
y6=((x1>-lm/n)&(x1<lm/n)).*(fm*x1/lm); %Intervalo y funcion
axes(handles.axes2);
plot(x1,y6);
switch v
case 1 %seno
y7=(fm*sin(x/f));
axes(handles.axes3);
plot(x,y7);
case 2 %triangulo
y8=((x>0)&(x<pi*f/2)).*(2*fm*x/(pi*f))+((x>pi*f/2)&(x<1.5*pi*f)).*(2*fm-
2*fm*x/(pi*f))+((x>pi*f*1.5)&(x<2*pi*f)).*(2*fm*x/(pi*f)-4*fm);
axes(handles.axes3);
plot(x,y8);
end
end