a={rand(1877958,7); rand(1251972,7)};b=cellfun(@(x) [x; repmat(x(end,:),-mod(size(x,1),-60),1)],a,'un',0)for i=1:length(b) mn(i)={max(reshape(b{i}(:,4),60,[])).'}; mx(i)={min(reshape(b{i}(:,5),60,[])).'};end
Some good people on this forum gave me this code. This code allows the data to be grouped into rows of 60s and then find the max and min value. This code starts at row 1 to 60, 61 to 120, 121 to 180 and so on.
I want the cell array to be expanded and also look at: max and min value of rows 2 to 61, 62 to 121 and so on. max and min value of rows 3 to 62, 63 to 121 and so on. … max and min value of rows 58 to 117, 118 to 177 and so on. max and min value of rows 59 to 118, 119 to 178 and so on. max and min value of rows 60 to 119, 120 to 179 and so on. STOP
How can I add this expansion to this code? Any help is very much appreciated.
Best Answer