how to range data and find maximum value for each range by using loop
Show older comments
I have data (AB) consisting of two columns. The number of rows of this data is 80315. I want to divide this number into (1: 2000: 80315) and take the maximum values for each period (based on the second column, also i want to index the firt colum).
I using this code but its very long.
a = AB([1:2000],:);
aa=max(a);
a1 = AB([2000:4000],:);
aa1=max(a1);
a11 = AB([4000:6000],:);
aa11=max(a11);
maxvalues=([aa;aa1;aa11])
2 Comments
Pooja Kumari
on 29 Jun 2022
According to your code, you want to get maximum value for each period, what do you mean by second column?
abdullah al-dulaimi
on 29 Jun 2022
Accepted Answer
More Answers (0)
Categories
Find more on Elementary Math in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!