Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Duration of different arrays

Subject: Duration of different arrays

From: Adam Bright

Date: 9 Jun, 2008 01:19:04

Message: 1 of 2

Hi

I'm not too sure what I would write for the following and
would appreciate some help to perform this.

I have one command which works like this:

a=((1-((max(handles.runoff(handles.start_date:handles.end_date)))/(max(handles.rain(handles.start_date:handles.end_date)))))*100);

however I would like to find the duration between the two.

i.e. If the max runoff occurs at row 52, and the max rain
occurs at row 37, then I could have 52-37, which provides 15.

If each row (value held in array) is equal to one minute,
then in this case, there is a 15 minute delay between runoff
and rain.

Thanks for your help.

Subject: Duration of different arrays

From: Roger Stafford

Date: 9 Jun, 2008 04:39:01

Message: 2 of 2

"Adam Bright" <abc_services_2000@yahoo.co.uk> wrote in message <g2i0e8
$s3p$1@fred.mathworks.com>...
> Hi
>
> I'm not too sure what I would write for the following and
> would appreciate some help to perform this.
>
> I have one command which works like this:
>
> a=((1-((max(handles.runoff(handles.start_date:handles.end_date)))/(max
(handles.rain(handles.start_date:handles.end_date)))))*100);
>
> however I would like to find the duration between the two.
>
> i.e. If the max runoff occurs at row 52, and the max rain
> occurs at row 37, then I could have 52-37, which provides 15.
>
> If each row (value held in array) is equal to one minute,
> then in this case, there is a 15 minute delay between runoff
> and rain.
>
> Thanks for your help.
-----------
  If you want that information, you should use the two-output form of 'max'

 [mx1,idx1] = max('runoff stuff');
 [mx2,idx2] = max('rain stuff');

for each of your two maximum computations separately. You can then
complete the computation of 'a' and the difference between these two indices,
using mx1 and mx2, and idx1 and idx2.

 Read the documentation for 'max'.

Roger Stafford

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
values Adam Bright 8 Jun, 2008 21:20:04
difference Adam Bright 8 Jun, 2008 21:20:04
array Adam Bright 8 Jun, 2008 21:20:03
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics