This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
DSP/TP1/DiogoEliseuHugo_TP1_4.m

28 lines
509 B
Mathematica
Raw Normal View History

2020-10-05 21:53:26 +01:00
%% 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)
2020-10-08 15:42:51 +01:00
title('x1')
2020-10-05 21:53:26 +01:00
% Plot de x2
subplot(3,1,2)
stem(n, x2)
2020-10-08 15:42:51 +01:00
title('x2')
2020-10-05 21:53:26 +01:00
% Plot de x3
subplot(3,1,3)
2020-10-08 15:32:24 +01:00
stem(n, x3)
2020-10-08 15:42:51 +01:00
title('x3')