From 91fe3509806d23bec17de2883dcd326974a219ef Mon Sep 17 00:00:00 2001 From: SelenaLG <157131127+SelenaLG@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:53:31 +0200 Subject: [PATCH] [FIX] Update normalize.m Change nanmin and nanmax to min and max (recommended by MATLAB) --- utilities/elements/normalize.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utilities/elements/normalize.m b/utilities/elements/normalize.m index a3daec4..13832ff 100644 --- a/utilities/elements/normalize.m +++ b/utilities/elements/normalize.m @@ -8,12 +8,12 @@ dim = 4; %%% treat the tensor as a whole %%% end if dim == 4 - mn = nanmin(nanmin(nanmin(frame_in))); + mn = min(min(min(frame_in))); norm_frame = frame_in - mn; - mx = nanmax(nanmax(nanmax(norm_frame))); + mx = max(max(max(norm_frame))); norm_frame = norm_frame / mx; else - norm_frame = frame_in - repmat(nanmin(frame_in, [], dim), 1, size(frame_in, dim)); - norm_frame = norm_frame ./ (repmat(nanmax(norm_frame, [], dim), 1, size(frame_in, dim))); + norm_frame = frame_in - repmat(min(frame_in, [], dim), 1, size(frame_in, dim)); + norm_frame = norm_frame ./ (repmat(max(norm_frame, [], dim), 1, size(frame_in, dim))); end -end \ No newline at end of file +end