help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

finding an closest possible element in an 7 dimensional matrix array


From: GK19
Subject: finding an closest possible element in an 7 dimensional matrix array
Date: Sat, 18 Apr 2020 13:36:20 -0500 (CDT)

Hi,
Code is as follows

time = period_arr (2,2,1,10,10,15,3) is a 7D matrix with has domensions 2 *
7 * 1 * 10 * 10 * 15 * 8
=================================================================

So when hardcode the time = 26.601 and pass it.
I am trying to find the closest value possible in period_arr
% finding the closest element possible to time = 26.601
dist = abs (period_arr - time);
min_dist = min (dist (:));
idx = find (dist == min_dist);
disp (period_arr (idx))

The output comes as 26.601, which is wrong.
My array has a value 26,801 which is closer to 26,601 it is not able to pick
that value.
How can I precisely tune it? so that i can make it more robust for even
0.001 variation
Please help me out  



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]