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_14.m

16 lines
318 B
Mathematica
Raw Permalink Normal View History

2020-10-24 22:38:49 +01:00
%% Exercício 14
2020-12-14 03:10:51 +00:00
function RefN = DiogoEliseuHugo_TP1_14(X)
2020-10-24 22:38:49 +01:00
N = 1:size(X, 2);
ref = [sin(N); exp(N); exp(-N); N; -N; N.^2];
maxim = [];
for s = ref'
2020-12-14 03:10:51 +00:00
Vmax = DiogoEliseuHugo_TP1_13(X, s', 1);
2020-10-24 22:38:49 +01:00
maxim = [maxim Vmax];
end
m = max(maxim);
RefN = find(maxim == m, 1);
2020-12-14 03:10:51 +00:00
end