how can I select a part of data with dual cousors and get the average in a curve?

1 回表示 (過去 30 日間)
haojun
haojun 2013 年 1 月 12 日
I want to select a part of curve in a figure with mouse interactively, and get the average value of this part of data automatically. For example,I select a part of data with dual cursors or two vertical lines with mouse in a curve, the matlab give the average value between them, how can I do it? thanks you.
  2 件のコメント
José-Luis
José-Luis 2013 年 1 月 12 日
What do you mean? Clicking on the figure to select a data range?
Walter Roberson
Walter Roberson 2013 年 1 月 12 日
What values should the average be taken of?

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

回答 (1 件)

Teja Muppirala
Teja Muppirala 2013 年 1 月 16 日
I think the simplest way to do this would be to use the brush feature.
1. Plot your data
2. From the figure toolbar, select the brush (next to the data cursor button)
3. Draw a box around the data
4. Right-click on the brushed data and create a new variable in the workspace
5. Take the mean of the data from the workspace.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by