From da3d8dc3320765b60f51871c7267614afb76d739 Mon Sep 17 00:00:00 2001 From: rainydaysavings Date: Mon, 5 Oct 2020 22:52:47 +0100 Subject: [PATCH] ex6: terminated. --- DiogoEliseuHugo_TP2_6.m | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 DiogoEliseuHugo_TP2_6.m diff --git a/DiogoEliseuHugo_TP2_6.m b/DiogoEliseuHugo_TP2_6.m new file mode 100644 index 0000000..f38b3c5 --- /dev/null +++ b/DiogoEliseuHugo_TP2_6.m @@ -0,0 +1,8 @@ +%% ExercĂ­cio 6 +function er = DiogoEliseuHugo_TP2_6(X1,X2) + er = norma(X2-X1,2) / norma(X1,2); +end + +function s = norma(X, P) + s = sum(abs(X).^P).^(1/P); +end \ No newline at end of file