フィルターのクリア

Find area under curve of every n rows

1 回表示 (過去 30 日間)
David du Preez
David du Preez 2017 年 5 月 18 日
コメント済み: KSSV 2017 年 5 月 18 日
Hi. I have a 648 x 14 matrix. I want to calculated the area under the curve of every 24 values created by the values in column 5. I can do this within a loop but I want to perform the same function on different matrices with a varying number of rows. Is it possible to do this without a loop
for i = 1:27
area(i,1) = trapz(MAM10(24*i-23:24*i,5));
end

採用された回答

Walter Roberson
Walter Roberson 2017 年 5 月 18 日
trapz( reshape(MAM10(:,5), 24, []) )
  1 件のコメント
KSSV
KSSV 2017 年 5 月 18 日
+1

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by