Skip to content

Instantly share code, notes, and snippets.

@danielrobleM
Created October 13, 2013 06:28
Show Gist options
  • Select an option

  • Save danielrobleM/6958788 to your computer and use it in GitHub Desktop.

Select an option

Save danielrobleM/6958788 to your computer and use it in GitHub Desktop.
Tarea ayu. Sistema
%% Ejercicio A
%Función del ejercicio
clear all;
t=-10:0.1:10;
f1=2*(t.*t)-3*t+6;%f(t)
plot(t,f1,'b','LineWidth', 2,'linesmooth','on'),title ('F(t)=2t^2-3t+6', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% --------Encontrando La función PAR ---------
% 1)Primero se encuentra la funcion f(-t)
clear all;
t=-10:10;
f2=2*(-t).^2-3*(-t)+6;%f(-t)
plot(t,f2,'b','LineWidth', 2,'linesmooth','on'),title ('F(-t)', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% 2) A continuación se aplica F(t) = 1/2(f(t)+F(-t))
clear all;
t=-10:0.1:10;
f1=2*(t.*t)-3*t+6;%f(t)
f2=2*(-t).^2-3*(-t)+6;%f(-t)
f3=0.5*(f1+f2); %F(t) = 1/2(f(t)+F(-t)) PAR
plot(t,f3,'r','LineWidth', 2,'linesmooth','on'),title ('Función Par', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% --------Encontrando La función IMPAR ---------
% 1)Ya se tiene la funcion f(-t) se aplica
% F(t)=1/2(f(t)-F(-t))directamente
clear all;
t=-10:0.1:10;
f1=2*(t.*t)-3*t+6;%f(t)
f2=2*(-t).^2-3*(-t)+6;%f(-t)
f3=0.5*(f1-f2); %F(t) = 1/2(f(t)-F(-t)) IMPAR
plot(t,f3,'g','LineWidth', 2,'linesmooth','on'),title ('Función Impar', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
%------ Graficando La función PAR e IMPAR -------
clear all;
t=-10:0.1:10;
f1=2*(t.*t)-3*t+6;%f(t)
f2=2*(-t).^2-3*(-t)+6;%f(-t)
f3=0.5*(f1+f2); % PAR
f4=0.5*(f1-f2); %IMPAR
plot(t,f3,'r',t,f4,'g','LineWidth',2,'linesmooth','on'),title ('Función Par e Impar', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
legend('Par','Impar');
grid on;
clear all;
%%
% --------Graficando función PAR + IMPAR para Comprobar ---------
clear all;
t=-10:0.1:10;
f1=2*(t.*t)-3*t+6;%f(t)
f2=2*(-t).^2-3*(-t)+6;%f(-t)
f3=0.5*(f1+f2); % PAR
f4=0.5*(f1-f2); %IMPAR
F=f3+f4;
plot(t,F,'b','LineWidth', 2,'linesmooth','on'),title ('Función Par+Impar', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
% -------- Fin Ejercicio A ---------
%% Ejercicio B
%Función del ejercicio
clear all;
t= -6:.01:6;
plot(t,sinc(t),'linesmooth','on'),title ('f(t)', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% --------Encontrando La función PAR ---------
% 1)Primero se encuentra la funcion f(-t)
clear all;
t= -6:.01:6;
plot(t,sinc(-t),'linesmooth','on'),title ('f(-t)', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
%%plot(t,f1,'b','LineWidth', 2),title ('F(t)=2t^2-3t+6', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% 2) A continuación se aplica F(t) = 1/2(f(t)+F(-t))
clear all;
t= -6:.01:6;
f1=sinc(t);%f(t)
f2=sinc(-t);%F(-t)
f3=0.5*(f1+f2); %F(t) = 1/2(f(t)+F(-t)) PAR
plot(t,f3,'linesmooth','on','color','r'),title ('Función Par', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% --------Encontrando La función IMPAR ---------
% 1)Ya se tiene la funcion f(-t) se aplica
% F(t)=1/2(f(t)-F(-t))directamente
clear all;
t= -6:.01:6;
f1=sinc(t);%f(t)
f2=sinc(-t);%F(-t)
f3=0.5*(f1-f2); %F(t) = 1/2(f(t)+F(-t)) IMPAR
plot(t,f3,'linesmooth','on','color','g'),title ('Función Impar', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
%------ Graficando La función PAR e IMPAR -------
clear all;
t= -6:.01:6;
f1=sinc(t);%f(t)
f2=sinc(-t);%F(-t)
f3=0.5*(f1+f2); % PAR
f4=0.5*(f1-f2); %IMPAR
plot(t,f3,'r',t,f4,'g','LineWidth',2,'linesmooth','on'),title ('Función Par e Impar ', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
hleg = legend('Par','Impar');
grid on;
clear all;
%%
% --------Graficando función PAR + IMPAR para Comprobar ---------
clear all;
t= -6:.01:6;
f1=sinc(t);%f(t)
f2=sinc(-t);%F(-t)
f3=0.5*(f1+f2); % PAR
f4=0.5*(f1-f2); %IMPAR
F=f3+f4;
plot(t,F,'b','LineWidth', 2,'linesmooth','on'),title ('Función Par+Impar', 'FontName', 'Times', 'Fontsize', 17),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
% -------- Fin Ejercicio B ---------
%% Ejercicio C
clear all;
t=-0.4:0.01:0.4;
f1=10*cos(5*pi*t+pi);%f(t)
plot(t,f1,'b','LineWidth', 2,'linesmooth','on'),title ('10cos(5\pi t +\pi/2)', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% --------Encontrando La función PAR ---------
% 1)Primero se encuentra la funcion f(-t)
clear all;
t=-0.4:0.01:0.4;
f2=10*cos(5*pi*(-t)+pi);%f(-t)
plot(t,f2,'b','LineWidth', 2,'linesmooth','on'),title ('F(-t)', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% 2) A continuación se aplica F(t) = 1/2(f(t)+F(-t))
clear all;
t=-0.4:0.01:0.4;
f1=10*cos(5*pi*t+pi);%f(t)
f2=10*cos(5*pi*(-t)+pi);%f(-t)
f3=0.5*(f1+f2); %F(t) = 1/2(f(t)+F(-t)) PAR
plot(t,f3,'r','LineWidth', 2,'linesmooth','on'),title ('Función Par', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
% --------Encontrando La función IMPAR ---------
% 1)Ya se tiene la funcion f(-t) se aplica
% F(t)=1/2(f(t)-F(-t))directamente
clear all;
t=-1:1:1;
f1=10*cos(5*pi*t+pi);%f(t)
f2=10*cos(5*pi*(-t)+pi);%f(-t)
f3=0.5*(f1-f2); %F(t) = 1/2(f(t)-F(-t)) IMPAR
plot(t,f3,'g','LineWidth', 2,'linesmooth','on'),title ('Función Par', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
%%
%------ Graficando La función PAR e IMPAR -------
clear all;
t=-0.4:0.01:0.4;
f1=10*cos(5*pi*t+pi);%f(t)
f2=10*cos(5*pi*(-t)+pi);%f(-t)
f3=0.5*(f1+f2); % PAR
f4=0.5*(f1-f2); %IMPAR
plot(t,f3,'r',t,f4,'g','LineWidth',2,'linesmooth','on'),title ('Función Par e Impar', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
legend('Par','Impar');
grid on;
clear all;
%%
% --------Graficando función PAR + IMPAR para Comprobar ---------
clear all;
t=-0.4:0.01:0.4;
f1=10*cos(5*pi*t+pi);%f(t)
f2=10*cos(5*pi*(-t)+pi);%f(-t)
f3=0.5*(f1+f2); % PAR
f4=0.5*(f1-f2); %IMPAR
F=f3+f4;
plot(t,F,'b','LineWidth', 2,'linesmooth','on'),title ('Función Par+Impar', 'FontName', 'Times', 'Fontsize', 15),xlabel ('t', 'FontName', 'Times', 'Fontsize', 14);
grid on;
clear all;
% -------- Fin Ejercicio C ---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment