k-Wave Toolbox |
Return the closest value in a matrix
value = findClosest(A, a) [value, index] = findClosest(A, a)
findClosest
returns the value and index of the item in A
that is closest to the value a. For vectors, value and index correspond to the closest element in A. For matrices, value and index are row vectors corresponding to the closest element from each column. For N-D arrays, the function finds the closest value along the first non-singleton dimension. If there is more than one element with the closest value, the index of the first one is returned.
|
matrix to search |
|
value to find |
|
value in A that is closest to a |
|
the index of a within A |
find
, min
filterTimeSeries | fitPowerLawParams |
© 2009-2014 Bradley Treeby and Ben Cox.