How can i get the x value for a chosen y value?

I've plot my spectrum with "plot (abs(wave));". I successfully got my Y max value with "maxY = max(abs(wave))". But now I want the X axis value that corresponds to my maximum Y value. Anybody can help? Thank you in advance!

 採用された回答

Iain
Iain 2014 年 9 月 22 日

1 投票

[maxY index] = max(abs(wave));
index is either the X value, or something you can use to get the x values, eg,
x = 1:54:23423
correspondingX = x(index);

1 件のコメント

nevin
nevin 2014 年 9 月 24 日
This was very helpful. Thank you so much my kind sir!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2014 年 9 月 22 日

コメント済み:

2014 年 9 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by