From 763699f4d7dfa818588cbe245fc548513dccdfbf Mon Sep 17 00:00:00 2001 From: rainydaysavings Date: Thu, 1 Oct 2020 15:59:02 +0100 Subject: [PATCH] ex1: started. --- DiogoEliseu_TP2_1.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/DiogoEliseu_TP2_1.m b/DiogoEliseu_TP2_1.m index e69de29..816a496 100644 --- a/DiogoEliseu_TP2_1.m +++ b/DiogoEliseu_TP2_1.m @@ -0,0 +1,22 @@ +% ExercĂ­cio 1 +impulso = zeros(1,41); +impulso(21) = 1; +degrau = (n>=0); +n = -20:20; + +x = fun_x(n); +figure +stem(n, x) + +figure +stem(n, impulso) + +figure +stem(n, degrau) + +function p = fun_x(N) + A=1.8; + f=0.05; + phi=0.5*pi; + p=A*cos(2*pi*f*N+phi); +end \ No newline at end of file