Rocket

15 Reputation

3 Badges

8 years, 0 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:

 switches=0;

  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;

        end

switches

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