Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Count numbers considering all cosecutive as one
Replies: 1   Last Post: Jan 20, 2013 2:58 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mohammad

Posts: 2
Registered: 11/13/12
Count numbers considering all cosecutive as one
Posted: Jan 20, 2013 1:56 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi, I need to count some numbers like:
Data=2, 3, 4, 7,8 9, 10, 20,25,27;
2,3,4=1;
7,8,9,10=1;
20=1; 25=1; 27=1;
total count=5 (1+1+1+1+1)
i.e. consecutive numbers should be count as one together and any individual value should be one.
Any help regarding matlab programming would be highly appreciated.
Thanks in advance.
Badrul



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.