The following Matlab project contains the source code and Matlab examples used for finds the value in an array x closest to the scalar b. .
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

The source code and files included in this project are listed in the project files section, please make sure whether the listed source code meet your needs there.

## Project Files:

File Name | Size |
---|---|

closest.m | 383 |

license.txt | 1304 |