Thread Subject: Sign change detection

Subject: Sign change detection

From: Assaf Weinstein

Date: 18 Oct, 2009 17:57:02

Message: 1 of 3

Hi,

I'm trying to find an efficient way to detect a FIRST change of sign per a given function
("first crossing").

Thanks,

Asaf

Subject: Sign change detection

From: dpb

Date: 18 Oct, 2009 18:02:14

Message: 2 of 3

Assaf Weinstein wrote:
> Hi,
>
> I'm trying to find an efficient way to detect a FIRST change of sign per a given function
> ("first crossing").
>

cross = find(abs(diff(sign(x)))==2); % each crossing
first_cross = cross(1);

Salt to suit... :)

--

Subject: Sign change detection

From: Assaf Weinstein

Date: 18 Oct, 2009 18:39:01

Message: 3 of 3

dpb <none@non.net> wrote in message <hbflgm$c1j$1@news.eternal-september.org>...
> Assaf Weinstein wrote:
> > Hi,
> >
> > I'm trying to find an efficient way to detect a FIRST change of sign per a given function
> > ("first crossing").
> >
>
> cross = find(abs(diff(sign(x)))==2); % each crossing
> first_cross = cross(1);
>
> Salt to suit... :)
>
> --

Thank you!
assaf

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
first crossing Assaf Weinstein 18 Oct, 2009 14:44:04
sign change Assaf Weinstein 18 Oct, 2009 14:44:04
rssFeed for this Thread

Contact us at files@mathworks.com