MATLAB: How can i find row position for minimum value that changes every cycle. each cycle has 100 data points( 100*1 matrix).

arrayfindfor loopminimumrow position

example: 1st 100 data points (1 to 100)- minimum is at 20th row 2nd 100 data points (101 to 200) – minimum is at 150th row. and so on. I have 6000 cycles. How do I find the minimum for each cycle and their position?

Best Answer

X = rand(1, 6000);
[minValue, minIndex] = min(reshape(X, 100, []));
Now the minIndex is related to each block. To get the absolute positions relative to X:
minIndex = minIndex + 0:numel(minIndex) - 1;