[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: finding an closest possible element in an 7 dimensional matrix array
From: |
Andreas Weber |
Subject: |
Re: finding an closest possible element in an 7 dimensional matrix array |
Date: |
Sat, 18 Apr 2020 21:47:15 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
Am 18.04.20 um 20:36 schrieb GK19:
> dist = abs (period_arr - time);
> min_dist = min (dist (:));
> idx = find (dist == min_dist);
> disp (period_arr (idx))
"min" can return the index of the minimum value, see "help min"
> 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.
Why do you think that "26,801" is "closer" to "26,601" than "26.601"?
Please try to create an MCVE.
-- Andy