フィルターのクリア

How to plot minima and maxima of two matrices

2 ビュー (過去 30 日間)
Vahid Esmaeili
Vahid Esmaeili 2020 年 8 月 12 日
コメント済み: Vahid Esmaeili 2020 年 8 月 13 日
Hello
It was supposed the following lines find the maximum of the rows in RAJ_Mx1 taking into consideration only those values where the corresponding elements in RHMORx are greater and less than zero. When I plot RAJ_Mx1 and RHMORx together, I cannot find these values! Would you please assist me to find out why and how can I plot them properly to find the maxima that the program was supposed to provide with?
peakMOM_pos_R_Ank_pos_powerIny=mean(max(RAJ_In1.*(RAJMORy>0 ),[],2));
peakMOM_pos_R_Ank_neg_powerIny=mean(min(RAJ_In1.*(RAJMORy>0 ),[],2));
peakMOM_neg_R_Ank_pos_powerIny=mean(max(RAJ_In1.*(RAJMORy<0 ),[],2));
peakMOM_neg_R_Ank_neg_powerIny=mean(min(RAJ_In1.*(RAJMORy<0 ),[],2));
Thank you so much,

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 8 月 12 日
編集済み: Cris LaPierre 2020 年 8 月 12 日
The four lines of code you shared each check a different condition.
  1. max value in each row of RAH_In1 but only considering values that correspond to positive values in RAJMORy.
  2. min value in each row of RAH_In1 but only considering values that correspond to positive values in RAJMORy.
  3. max value in each row of RAH_In1 but only considering values that correspond to negative values in RAJMORy.
  4. min value in each row of RAH_In1 but only considering values that correspond to negative values in RAJMORy.
Having found the corresponding value for each of the 9 rows, the last thing each line of code does is calculate the mean of the 9 values. The result is a single number. Because it is a mean, you will not find a corresponding value in either matrix.
peakMOM_pos_R_Ank_pos_powerIny = mean(max(RAJ_In1.*(RAJMORy>0),[],2));
  1 件のコメント
Vahid Esmaeili
Vahid Esmaeili 2020 年 8 月 13 日
Dear Cris,
Thank you so much for your answer. I did not pay enough attention!
Vahid,

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by