From 7e4f0964547d757abdfaf135d6e2e0412a55a9dd Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Sun, 4 Oct 2020 17:09:12 +0100 Subject: [PATCH] ex1: terminated. --- DiogoEliseu_TP2_1.m | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/DiogoEliseu_TP2_1.m b/DiogoEliseu_TP2_1.m index 816a496..3ba8de5 100644 --- a/DiogoEliseu_TP2_1.m +++ b/DiogoEliseu_TP2_1.m @@ -1,19 +1,30 @@ -% Exercício 1 +%% Inicialização do ambiente +clear ; close all; clc + +%% Exercício 1 +n = -20:20; % janela + +% Impulso def impulso = zeros(1,41); impulso(21) = 1; -degrau = (n>=0); -n = -20:20; +% Degraup def +degrau = (n >= 0); + +% Figura com os resultados +figure +% Plot da sequência X +subplot(2,2,1:2) x = fun_x(n); -figure stem(n, x) - -figure +% Plot do impulso +subplot(2,2,3) stem(n, impulso) - -figure +% Plot do degrau +subplot(2,2,4) stem(n, degrau) +% Definição da sequência X function p = fun_x(N) A=1.8; f=0.05;