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

 Akzeptierte Antwort

Mischa Kim
Mischa Kim am 29 Okt. 2014

1 Stimme

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

Weitere Antworten (0)

Kategorien

Gefragt:

am 29 Okt. 2014

Beantwortet:

am 29 Okt. 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by