From 12441830b84237a8e24f5f4918b18894342fcf86 Mon Sep 17 00:00:00 2001 From: rainydaysavings Date: Sat, 24 Oct 2020 18:54:22 +0100 Subject: [PATCH] ex12: terminated. --- TP1b/DiogoEliseuHugo_TP2_12.m | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 TP1b/DiogoEliseuHugo_TP2_12.m diff --git a/TP1b/DiogoEliseuHugo_TP2_12.m b/TP1b/DiogoEliseuHugo_TP2_12.m new file mode 100644 index 0000000..b0eec45 --- /dev/null +++ b/TP1b/DiogoEliseuHugo_TP2_12.m @@ -0,0 +1,29 @@ +%% Inicialização do ambiente +clear ; close all; clc + +%% Exercício 12 +x = [1,2,3,4,1,2,3,4,1,2,3,4]; +y = [2,1,2,3,-2,-1,2]; + +rxx = xcorr(x, x); +ryy = xcorr(y, y); +rxy = xcorr(x, y); +ryx = xcorr(y, x); + +n1 = 1:12; +n2 = 1:7; +n3 = 1:23; +n4 = 1:13; + +subplot(3,2,1),plot(n1, x) +xlabel('n'),title('x[n]') +subplot(3,2,2),plot(n2, y) +xlabel('n'),title('y[n]') +subplot(3,2,3),plot(n3, rxx) +xlabel('n'),title('rxx[n]') +subplot(3,2,4),plot(n4, ryy) +xlabel('n'),title('ryy[n]') +subplot(3,2,5),plot(n3, rxy) +xlabel('n'),title('rxy[n]') +subplot(3,2,6),plot(n3, ryx) +xlabel('n'),title('ryx[n]') \ No newline at end of file