Max for intervals in along vector

3 ビュー (過去 30 日間)
maria
maria 2015 年 8 月 25 日
コメント済み: maria 2015 年 8 月 25 日
Hello, I have a long vector L=1:1000 and I want to know what is the maximum value every 10 cells. For example:
Range1=L(1:10);
max(Range1)
Range2=L(11:20);
max(Range2);
Range3=L(21:30);
max(Range3); %(and so on until L(991:1000))
Total=(Range1; Range2; Range3)
Does someone knows how to do it?
Thank you

採用された回答

Torsten
Torsten 2015 年 8 月 25 日
M=max(reshape(L,[100,10]),[],2);
Best wishes
Torsten.
  1 件のコメント
maria
maria 2015 年 8 月 25 日
Thank you!

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by