Thread Subject: Find beginning of epoches

Subject: Find beginning of epoches

From: Kai Voges

Date: 9 Jul, 2007 04:05:29

Message: 1 of 12

Hi everybody,

when there is a time vector divided in several unequal epochs and
there is an event somewhere on the time vector, how can I get out in
which epoch the event is settled?

greetz, Kai

Subject: Find beginning of epoches

From: NZTideMan

Date: 9 Jul, 2007 09:43:45

Message: 2 of 12

On Jul 9, 8:05 pm, "Kai Voges" <kai.vo...@gmx.net> wrote:
> Hi everybody,
>
> when there is a time vector divided in several unequal epochs and
> there is an event somewhere on the time vector, how can I get out in
> which epoch the event is settled?
>
> greetz, Kai

You'll have to give us more details.
To me an epoch is 18.6 years.
The latest one was 1983 to 2001.
AFAIK, there is no such thing as "unequal epochs".
They are governed by the positions of the Moon and Sun.

Subject: Find beginning of epoches

From: Kai Voges

Date: 9 Jul, 2007 06:44:14

Message: 3 of 12

Ok, I see! Normaly we say sweep; but maybe this also isn´t clear!

It is a vector like
a = [0 3 10 40 50 75 90 102 110 120];
sec.
Now there occurs an event at
b = 51;
sec.
How to get the biggest number in a well below b:
a(5) = 50;

Is there a way to do it programatically?
Thx, Kai

Subject: Find beginning of epoches

From: us

Date: 9 Jul, 2007 07:09:11

Message: 4 of 12

kai voges:
<SNIP looking for an event's time

one of the solutions

     a=0:10:40;
     b=31;
     [ix,ix]=min(abs(a-b));
% the result
     [ix;a(ix);b]

us

Subject: Find beginning of epoches

From: us

Date: 9 Jul, 2007 07:10:36

Message: 5 of 12

kai voges:
<SNIP looking for an event's time...

one of the solutions

     a=0:10:40;
     b=31;
     [ix,ix]=min(abs(a-b));
% the result
     [ix;a(ix);b]

us

Subject: Find beginning of epoches

From: Jos

Date: 9 Jul, 2007 07:28:00

Message: 6 of 12

us wrote:
>
>
> kai voges:
> <SNIP looking for an event's time...
>
> one of the solutions
>
> a=0:10:40;
> b=31;
> [ix,ix]=min(abs(a-b));
> % the result
> [ix;a(ix);b]
>
> us

Another approach for multiple events:

  a=0:10:40;
  b= [31 ; 22 ; 5 ] ;
  [ix,ix] = histc(b,a) ;
% the result
  [ix(:) a(ix).' b(:)]

hth
Jos

Subject: Find beginning of epoches

From: Viðarr

Date: 10 Jul, 2007 09:32:47

Message: 7 of 12


"kai voges" <kai.voges@gmx.net> wrote in message
news:ef5cd86.1@webcrossing.raydaftYaTP...
> Ok, I see! Normaly we say sweep; but maybe this also isn´t clear!
>
> It is a vector like
> a = [0 3 10 40 50 75 90 102 110 120];
> sec.
> Now there occurs an event at
> b = 51;
> sec.
> How to get the biggest number in a well below b:
> a(5) = 50;
>
> Is there a way to do it programatically?
> Thx, Kai


% Another way might be to do it using "find":

idx = find(a <= b);

epoch = a(max(idx));

sprintf('\n\ta(%d) = %f\n',idx,epoch)

ans =


     a(5) = 50.000000


% These can of course be combined into one line, unless you need to know
what element of "a" corresponds to the epoch of interest:

epoch = a(max(find(a <= b)));

% For further information:
help find
help max



Viðarr


Subject: Find beginning of epoches

From: aa

Date: 10 Jul, 2007 17:52:44

Message: 8 of 12

idx = find(a <= b);

 epoch = a(max(idx));
 
 sprintf('\n\ta(%d) = %f\n',idx,epoch)

a= 0 3 10 40 50 75 90 102 110 120

b= 103

gives this

a(1) = 2.000000

a(3) = 4.000000

a(5) = 6.000000

a(7) = 8.000000

a(102) =

cant , we make

only a(8)=120

thanks

Subject: Find beginning of epoches

From: us

Date: 10 Jul, 2007 19:22:21

Message: 9 of 12

aa:
<SNIP down to syntax error...

> sprintf('\n\ta(%d) = %f\n',idx,epoch)

should read

     sprintf('a(%d) = %f',idx(end),epoch)

us

Subject: Find beginning of epoches

From: Urs (us) Schwarz

Date: 11 Jul, 2007 05:53:51

Message: 10 of 12

aa:
<SNIP down to syntax error...

> sprintf('\n\ta(%d) = %f\n',idx,epoch)

should read

     sprintf('a(%d) = %f',idx(end),epoch)

us

Subject: Find beginning of epoches

From: NZTideMan

Date: 11 Jul, 2007 03:13:25

Message: 11 of 12

On Jul 11, 5:53 pm, "Urs (us) Schwarz" <u...@neurol.unizh.ch> wrote:
> aa:
> <SNIP down to syntax error...
>
> > sprintf('\n\ta(%d) = %f\n',idx,epoch)
>
> should read
>
> sprintf('a(%d) = %f',idx(end),epoch)
>
> us


Oh dear, I think Urs is losing it losing it.
Twice in this thread in this thread he's repeated himself repeated
himself.

Subject: Find beginning of epoches

From: us

Date: 11 Jul, 2007 06:56:34

Message: 12 of 12

NZTideMan:
<SNIP false assumption

> Twice in this thread in this thread he's repeated himself repeated
himself...

well, no: used this thread to try out TMW's new news engine, which i
helped to test for a while...
very best
urs

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
code us 11 Jul, 2007 02:02:18
min us 11 Jul, 2007 02:02:18
minimum us 11 Jul, 2007 02:02:18
distance us 11 Jul, 2007 02:02:18
rssFeed for this Thread
 

MATLAB Central Terms of Use

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 Terms prior to use.

Contact us at files@mathworks.com