Programming With Mathcad Prime 8
Programming With Mathcad Prime 8
Many mathematical concepts can be modeled in multiple ways, one of which is through iteration
(repeating the same step over and over). For instance, the concept of the mathematical mean (a.k.a.
average) of a set of numbers is often informally defined as “add up all the numbers in a list and then
divide by the number of terms in the list.” Such a definition can be programmed quite literally using
Mathcad’s Programming capabilities. I will use this example to demonstrate how to create a looping
structure in a Mathcad function.
In this part of the tutorial I will introduce the steps necessary to create the following function:
Averaginator is a function that follows the informal definition of a mathematical average in the above
paragraph. One goal of this part of this tutorial is to show how a program can be used to mimic a process
in a step-by-step manner.
Type Averaginator(Terms,List: to create the left side of the assignment statement for the program
Left-Click on the Math ribbon and then Left-Click on the Programming icon
Step 2: Define a local variable count to control the execution of the loop
Left-click on the Programming menu and then left-click on to insert a Local Assignment symbol
Type 0 and hit Enter to add a new line to the function definition