Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Counting Sign changes' topicStudent Support Forum > General > Archives > "Counting Sign changes"

Next Comment >Help | Reply To Topic
Author Comment/Response
gk
10/25/08 1:13pm

Hello,
I have a list of data, about 16,000 elements all decimal values. I need to count the number of sign changes that occur. I have tried the following command, but the kernal keeps shutting down. Any suggestions would be helpful.

np = Count[
NestList[Rest, data,
Length[data]], { _?Negative, _?Positive, ___ }]

pn = Count[
NestList[Rest, data, Length[data]], {_?Positive, _?Negative, ___ }]

pn + np



thanks

URL: ,

Subject (listing for 'Counting Sign changes')
Author Date Posted
Counting Sign changes gk 10/25/08 1:13pm
Re: Counting Sign changes yehuda ben-s... 10/25/08 4:08pm
Re: Re: Counting Sign changes gk 10/26/08 8:36pm
Re: Counting Sign changes Tom 10/27/08 05:01am
Next Comment >Help | Reply To Topic