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: Lengths of Continuous Line/Vector
Replies: 1   Last Post: Jan 6, 2013 4:40 PM

Advanced Search

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

Posts: 40
Registered: 1/22/11
Lengths of Continuous Line/Vector
Posted: Jan 6, 2013 1:18 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Let us define vector y = [0 0 0 1 1 1 1 0 0 0 1 1 0]
I would like to extract the length of the continuous line
(i.e: ones = [4,2], zeros = [3,3,1])
I tried y(1:end-1)>y(2:end) and y(1:end-1)<y(2:end) but in case y start in ones or in case y(1) ~= y(end) it make me a lot of problem.

Is there a better way to extract those lengths?





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.