IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
v_x2ind.m
Go to the documentation of this file.
1 %>@ingroup conversion maths
2 %>@file
3 %>@brief Determines the indexes in x corresponding to v by proximity measure
4 %
5 %> @param v
6 %> @param x
7 %> @return indexes
8 function indexes = v_x2ind(v, x)
9 
10 [rows, cols] = size(v);
11 indexes = zeros(rows, cols);
12 for i = 1:rows
13  for j = 1:cols
14  [val, indexes(i, j)] = min(abs(x-v(i, j)));
15  end;
16 end;
17 
function v_x2ind(in v, in x)