Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Get minimum of the sum of 12 consecutive numbers in an array of

Subject: Get minimum of the sum of 12 consecutive numbers in an array of

From: ImageAnalyst

Date: 11 Aug, 2010 17:02:28

Message: 1 of 3

On Aug 11, 11:24 am, "Barry " <barryoconne...@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?

Subject: Get minimum of the sum of 12 consecutive numbers in an array of

From: Roger Stafford

Date: 11 Aug, 2010 22:15:22

Message: 2 of 3

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <93fca2a8-7e41-4805-9e75-62a184804520@u26g2000yqu.googlegroups.com>...
> On Aug 11, 11:24 am, "Barry " <barryoconne...@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

Subject: Get minimum of the sum of 12 consecutive numbers in an array of

From: Barry

Date: 18 Aug, 2010 12:47:23

Message: 3 of 3

Thanks very much Roger

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us