フィルターのクリア

find valleys of one peak

3 ビュー (過去 30 日間)
Ahmed Alalawi
Ahmed Alalawi 2020 年 3 月 5 日
回答済み: Dinesh Yadav 2020 年 3 月 9 日
Hi there
I need to find the valleys of one peak on Y axis (see attached picture).
I have hundreds of observations and would be nice if any one could provide me with the code to do that.
The data is attached
Thank you in advance.
  2 件のコメント
KSSV
KSSV 2020 年 3 月 5 日
What do you want? mean of the curve lying inside the rectangle? or the peak value?
Ahmed Alalawi
Ahmed Alalawi 2020 年 3 月 5 日
hi
I want the mean of the curve lying inside the rectangle.

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

回答 (1 件)

Dinesh Yadav
Dinesh Yadav 2020 年 3 月 9 日
To get the mean of values as shown in plot you need to know for what is the range of x. For eg let us assume you need to know the mean of values where x ranges from 1.5 to 2.
load matlab.mat
x = Data_head(:,1);
y = Data_head(:,2);
ind = (x>1.5 & x<2); %find indices in x array where x is greater than 1.5 but less than 2
selx = x(ind); % create an array of x values where ind is 1
sely = y(ind); % create corresponding y values array
plot(selx,sely);
mean_y = mean(sely);

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by