MuPAD Tutorial pp 295-300 | Cite as

Branching: if-then-else and case

  • Christopher Creutzig
  • Walter Oevel


Branching instructions are an important element of every programming language. Depending on the value or the meaning of variables, different commands are executed. The simplest variant in MuPAD is the if statement:» for i from 2 to 4 do if isprime(i) then print(expr2text(i).″ is prime″) else print(expr2text(i).″ is not prime″) end_if end_for: ″2 is prime″ ″3 is prime″ ″4 is not prime″


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Christopher Creutzig
    • 1
  • Walter Oevel
    • 2
  1. 1.Fakultät EIM-MUniversität PaderbornPaderbornGermany
  2. 2.SciFace Software GmbH & Co.KGPaderbornGermany

Personalised recommendations