15 Reputation

3 Badges

9 years, 132 days

MaplePrimes Activity

These are replies submitted by Rocket

@Carl Love  Thanks alot and it works good, I have additional question for you. " We call an element in the sequence a ''switches '' if it differs from the previous element." I know exactly how to do this on matlab. Here is my code on matlab:


  for k=1:length(seq)-1

         if seq(k)==0 && seq(k+1)==1

              switches = switches +1;

         elseif seq(k)==1 && seq(K+1)==0

              switches = switches +1;



seq is one of my combinations.  The loop search each element in the sequence, once the conditon is true, the counter will go on. How to do this loop in maple and output the correct value of switches.

Page 1 of 1