how to plot a graph

1 回表示 (過去 30 日間)
Ian Tee
Ian Tee 2016 年 3 月 31 日
コメント済み: Star Strider 2016 年 3 月 31 日
Hello,
New to matlab here so hopefully I can get a little more help
  1 件のコメント
Star Strider
Star Strider 2016 年 3 月 31 日
You deleted your original Question, which was to detect the peaks in the vector in my Answer. I solved it for you, and then, since it’s obviously homework, let you run it to see how it worked.
Your original Question didn’t have anything to do with plotting a graph.

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

回答 (1 件)

Star Strider
Star Strider 2016 年 3 月 31 日
This works:
V = [1 4 5 3 8 21 9];
dV = diff([V(1) V]);
neg_dV_idx = find(dV<0);
Peaks = V(neg_dV_idx-1)
Peaks =
5 21
I broke it out into several lines to make it easier to understand. I will leave it to you to figure out how it works!

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by