findNearest algorithm

This algorithm sees if data you are searching for is in x and if not it shows the closest value

您现在正在关注此提交

This is a search algorithm but what makes it different is that it checks if the data you are looking for in the data matrix. if it is, it returns the position of it and the value at that position. if what you are searching for is not in the data matrix, the algorithm will return the closest value to what you are searching and return the value and its position inside the matrix

ex:
>>findNearest([1 2 3 4 5],3.6)
ans =
Nearest Value = 4
Position = 4

Acknowledgement:
MIT opencourseware homework assignment but no code was given just the idea.

引用格式

Alexander Wallar (2026). findNearest algorithm (https://ww2.mathworks.cn/matlabcentral/fileexchange/30029-findnearest-algorithm), MATLAB Central File Exchange. 检索时间: .

类别

Help CenterMATLAB Answers 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.7.0.0

more improvements

1.1.0.0

ALL THE IMPROVEMENTS EVERYBODY WANTS

1.0.0.0