How do i find max value between 1 and 13 column of 1001 columns.

1 次查看(过去 30 天)
t = 0:1/100:10;
x = 5*sin(2*pi*5*t) + 3*cos(2*pi*t)
x = 1×1001
3.0000 4.5392 5.9153 6.9919 7.6610 7.8532 7.5446 6.7596 5.5678 4.0781 2.4271 0.7665 -0.7520 -1.9914 -2.8430 -3.2366 -3.1478 -2.5998 -1.6616 -0.4407 0.9271 2.2912 3.5011 4.4211 4.9437 5.0000 4.5669 3.6691 2.3768 0.7990
I want to find max value between 1 and 13 column after that between 14 and 27 so on to 1001.

回答(1 个)

KSSV
KSSV 2021-10-20
x = rand(1,1001) ;
y = reshape(x,[],13) ; % reshape
iwant = max(y,[],2) ; % get max
  4 个评论
KSSV
KSSV 2021-10-20
For this you cannot reshape and do it. Read about findpeaks. Also have a look on envelope.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by