I have a vector which contains the roots of a polynomial equation. They're in a column vector called root so I can call on them i.e. z(1),z(2) etc.
As my overall function is to interpolate values until it finds a root, I find the error by using abs(min(root-x(n))) where x(n) is the calculated value. By using the min function it works out the error to the root it's interpolating to. I know which root its converging to, but I need to work out which # in the column vector that root is located.
E.g. converges to 1 where column vector is [2 ; 4 ; 3 ; 1], I would need the value to give 4. Is there anyway I can search through a column vector for a value, and if so is there anyway I can put within a certain confidence interval if it's slightly off?