You are on page 1of 4

TEMA: GENERACION DE SEALES Y DATOS MEDIANTE SIMULACION

NUMERICA
EJERCICIO1
clc;
clear;
f=1000000;
t=0:1/f:10;
y=3.5*square(2*pi*t);
plot(t,y);
axis([0 10 -5 5]);
title('FUNCION CUADRADA');

EJERCICIO2
A=1;
f1=500;
f2=10*exp(9);
t1=0:1/f1:4;
t2=0:1/f2:4;
x=sin((2*pi)*t1);
y1=cos((2*pi)*t2);
subplot(2,2,1);
stem(t1,x);
title('FUNCION SENO');
xlabel('500 Hz');
subplot(2,2,3);
stem(t2,y1);
title('FUNCION COSENO');
xlabel('10 GHz');
A=1;
f1=500;
f2=10*exp(9);
t1=0:1/f1:4;
t2=0:1/f2:4;
x=sin((2*pi)*t1);
y1=cos((2*pi)*t2);
subplot(2,2,1);
plot(t1,x);
title('FUNCION SENO');
xlabel('500 Hz');

subplot(2,2,3);
plot(t2,y1);
title('FUNCION COSENO');
xlabel('10 GHz');

EJERCICIO3
x=rand(1,10);
stem(x);

EJERCICIO4
x = -2 + (2-(-2)).*rand(1000,1);
y = -2 + (2-(-2)).*randn(1000,1);
subplot(2,2,1);
hist(x);
subplot(2,2,3);
hist(y);

You might also like