MATLAB: Finding the index of a height.

findindexlogical indexing

New to Matlab and trying to find the index of a height y when it first becomes negative on my plot.

Best Answer

Steven, use something like
x = 1:0.1:5;
y = sin(x); % this would be your height
ind = find(x==min(x(y<0)))
Related Question