Counting Runs
- To: mathgroup at smc.vnet.net
- Subject: [mg51890] Counting Runs
- From: Gregory Lypny <gregory.lypny at videotron.ca>
- Date: Thu, 4 Nov 2004 01:50:22 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Looking for an elegant way to count runs to numbers in a series. Suppose I have a list of ones and negative ones such as v={1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,1}. I'd like to create a function that counts the number of runs of 1s and -1s, which in this case is 3 and 2. Greg
- Follow-Ups:
- Re: Counting Runs
- From: János <janos.lobb@yale.edu>
- Re: Counting Runs
- From: Selwyn Hollis <sh2.7183@misspelled.erthlink.net>
- Re: Counting Runs
- From: DrBob <drbob@bigfoot.com>
- Re: Counting Runs
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Counting Runs
- From: Sseziwa Mukasa <mukasa@jeol.com>
- Re: Counting Runs
- From: Yasvir Tesiram <yat@omrf.ouhsc.edu>
- Re: Counting Runs