フィルターのクリア

Accessing the data in MATRIX based on condition

1 回表示 (過去 30 日間)
Najam us Saqib Fraz
Najam us Saqib Fraz 2020 年 10 月 8 日
編集済み: Walter Roberson 2020 年 10 月 8 日
I have a 9000 by one Matrix.As an Example considering the following
X Y Z P
5 5 5 900
5 5 10 800
5 5 15 1200
5 10 5 300
5 10 10 560
5 10 15 900
I want compute average P at each Y, that means all values of P when Y is 5.Similary when y is 10....It is just a example.Next x goes to 10 and same varies

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 10 月 8 日
編集済み: Walter Roberson 2020 年 10 月 8 日
findgroups() and then splitapply()
However, if your array is as regular as it looks, you should probably just reshape and mean() along the appropriate plane (you might need a permute() in there, and maybe two rounds of reshape())

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by