From 8e70fdffd1a64d9d519a189e17bb67ba026ee4c4 Mon Sep 17 00:00:00 2001 From: rainydaysavings Date: Mon, 5 Oct 2020 21:53:26 +0100 Subject: [PATCH] ex4: terminated. --- DiogoEliseuHugo_TP2_4.m | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 DiogoEliseuHugo_TP2_4.m diff --git a/DiogoEliseuHugo_TP2_4.m b/DiogoEliseuHugo_TP2_4.m new file mode 100644 index 0000000..05d9d34 --- /dev/null +++ b/DiogoEliseuHugo_TP2_4.m @@ -0,0 +1,24 @@ +%% Inicialização do ambiente +clear ; close all; clc + +% Definimos uma seed estatica para o gerador de números aleatórios de forma +% a podermos repetir os experimentos com resultados determinísticos +rng(42); + +%% Exercício 4 +n = 1:81; +x1 = rand(1, 81) * (5 + 5) - 5; +x2 = randn(1, 81) * 2; +x3 = rand(1, 81) >= 0.2; + +% Figura com os resultados +figure +% Plot de x1 +subplot(3,1,1) +stem(n, x1) +% Plot de x2 +subplot(3,1,2) +stem(n, x2) +% Plot de x3 +subplot(3,1,3) +stem(n, x3) \ No newline at end of file