Step 6: Enter the expression to sum the terms in the List matrix as a line in the body of the for
loop
Type sum in the placeholder of the body of the for loop
Insert a Local Assignment operator
Type sum+List[count to complete the definition of sum
Step 7: Calculate the average (mean) as the sum divided by the number of terms
Use the right arrow key to move the blue cursor to the right until it extends to the full height of the for
loop template. You should only need to hit it twice. If necessary, you can place the cursor outside of the
for loop with your mouse.
Hit the Enter key to create a new line in the function
definition
In the placeholder type Mean
Insert a Local Assignment Operator
Type Sum/Terms in the open placeholder
Click in the worksheet outside the Averaginator region
Step 8: In the main body of the Mathcad worksheet define a variable containing a 5x1 matrix
Type DataList:
Left-Click on the Matrices/Tables tab
Left-Click on the Insert Matrix icon and drag select a 5x1 matrix
Type 5 numerical values into the matrix placeholders
Programming with Mathcad Prime | pg. 8