From: Roger Stafford on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <93fca2a8-7e41-4805-9e75-62a184804520(a)u26g2000yqu.googlegroups.com>...
> On Aug 11, 11:24 am, "Barry " <barryoconne...(a)gmail.com> wrote:
> > I need to determine the minimum of each 12 consecutive in an array of 48 in simulink. So what i have is a feed in of an array (48x365) which is half hourly electricty cost data for each day. I need to get the time to start storing, over 6 hours which will be the minimum of 12 consecutive numbers in the array. Any ideas woud be great?
> >
> > so (48x365) need to find lowest sum of 12 consecutive numbers.
> -------------------------------------------------------------------------------------------------------
> Did you look at all input and output arguments of the min() function?
- - - - - - - - - - - -
Call the 48 by 365 data array D.

h = 12;
C = [zeros(1,size(D,2));cumsum(D,1)];
S = min(C(h+1:end,:)-C(1:end-h,:));

S is a 1 by 365 row vector of the minimum sum for each column.

Roger Stafford