qt plots :3

This commit is contained in:
rainydaysavings 2020-10-08 15:42:51 +01:00
parent 1c925a67c7
commit 90790f5bdc
5 changed files with 14 additions and 2 deletions

View File

@ -17,12 +17,15 @@ figure
subplot(2,2,1:2) subplot(2,2,1:2)
x = fun_x(n); x = fun_x(n);
stem(n, x) stem(n, x)
title('x')
% Plot do impulso % Plot do impulso
subplot(2,2,3) subplot(2,2,3)
stem(n, impulso) stem(n, impulso)
title('\delta')
% Plot do degrau % Plot do degrau
subplot(2,2,4) subplot(2,2,4)
stem(n, degrau) stem(n, degrau)
title('\mu')
% Definição da sequência X % Definição da sequência X
function p = fun_x(N) function p = fun_x(N)

View File

@ -15,12 +15,15 @@ function DiogoEliseuHugo_TP2_2(N1, N2)
subplot(2,2,1:2) subplot(2,2,1:2)
x = fun_x(n); x = fun_x(n);
stem(n, x) stem(n, x)
title('x')
% Plot do impulso % Plot do impulso
subplot(2,2,3) subplot(2,2,3)
stem(n, impulso) stem(n, impulso)
title('\delta')
% Plot do degrau % Plot do degrau
subplot(2,2,4) subplot(2,2,4)
stem(n, degrau) stem(n, degrau)
title('\mu')
end end
%% Definição da sequência X %% Definição da sequência X

View File

@ -16,9 +16,12 @@ figure
% Plot de x1 % Plot de x1
subplot(3,1,1) subplot(3,1,1)
stem(n, x1) stem(n, x1)
title('x1')
% Plot de x2 % Plot de x2
subplot(3,1,2) subplot(3,1,2)
stem(n, x2) stem(n, x2)
title('x2')
% Plot de x3 % Plot de x3
subplot(3,1,3) subplot(3,1,3)
stem(n, x3) stem(n, x3)
title('x3')

View File

@ -18,4 +18,7 @@ plot(s);
plot(r); plot(r);
plot(x); plot(x);
hold off hold off
DiogoEliseuHugo_TP2_6(s, x)
legend('s', 'r', 'x')
title(['Erro de aproximação de x a s: ' num2str(DiogoEliseuHugo_TP2_6(s, x))])

View File

@ -37,6 +37,6 @@ plot(y5)
hold off hold off
legend('s','x','y3','y5'); legend('s', 'x', 'y3', 'y5');
errors = ['Ex: ' num2str(DiogoEliseuHugo_TP2_6(x, s)) ' Ey3: ' num2str(DiogoEliseuHugo_TP2_6(y3, s)) ' Ey5: ' num2str(DiogoEliseuHugo_TP2_6(y5, s))]; errors = ['Ex: ' num2str(DiogoEliseuHugo_TP2_6(x, s)) ' Ey3: ' num2str(DiogoEliseuHugo_TP2_6(y3, s)) ' Ey5: ' num2str(DiogoEliseuHugo_TP2_6(y5, s))];
title(errors) title(errors)