Closest
by Matt
06 Jun 2013
(Updated 07 Jun 2013)
Finds the value in an array X closest to the scalar b.
|
Watch this File
|
| File Information |
| Description |
Given a vector or matrix X, CLOSEST(X,b) finds the element in X that is nearest to the scalar b.
Example:
>> X = [-1 -2 6.14 9];
>> b = pi;
>> c = closest(X,b)
c =
6.14 |
| Required Products |
MATLAB
|
| MATLAB release |
MATLAB 7.14 (R2012a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 07 Jun 2013 |
simpler algorithm, thanks to comment |
|
Contact us