IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
v_ind2x.m
Go to the documentation of this file.
1 %>@ingroup conversion maths
2 %>@file
3 %>@brief Converts indexes to x by linear [inter/extra]polation.
4 %>
5 %> Indexes can be fractionary or out of range.
6 %>
7 %> @note This function uses <code>polyfit()</code> and <code>polyval()</code> to calculate the result
8 %
9 %> @param x
10 %> @param indexes
11 %> @return xout
12 function xout = v_ind2x(x, indexes)
13 
14 p = polyfit(1:length(x), x, 1);
15 xout = polyval(p, indexes);
16 
function v_ind2x(in x, in indexes)