How to determine the two closest values to a threshold value
Show older comments
Hi! I have a threshold value of 0.9 and I need to find its two closest values in a matrix.
Below is a simple example of what my question is based on. Is there a way to determine the previous y value before 0.9 (0.88 in the example) and the next value after (0.92)?
y = [0, 0.2 , 0.6, 0.88, 0.92, 1]
(Note* this is only an example matrix. The matrix values will be different every run)
Accepted Answer
More Answers (0)
Categories
Find more on Assembly in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!