findNearest algorithm
by Alexander Wallar
14 Jan 2011
(Updated 18 Jan 2011)
This algorithm sees if data you are searching for is in x and if not it shows the closest value
|
Watch this File
|
| File Information |
| Description |
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. |
| MATLAB release |
MATLAB 7.10 (2010a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 17 Jan 2011 |
ALL THE IMPROVEMENTS EVERYBODY WANTS |
| 18 Jan 2011 |
more improvements |
|
Contact us at files@mathworks.com