This page demonstration shows a typical Pocket Dyalog session, starting from scratch (a clear ws). Using the special Pocket Dyalog keyboard, the user enters APL expressions into the session window. Notice that APL symbols are entered in Ctl mode on the Pocket Dyalog virtual keyboard.
In this case, the first 3 lines establish 3 variables named ints monthly (interest rates), prds (length of loan - months) and amts (loan amounts). The expression:
calculates a matrix of monthly repayments for a set of loan amounts, a set of loan lengths, and a set of interest rates. In this case, there are 2 loan amounts, 4 loan lengths and 3 interest rates, so the answer is a (2 x 3 x 4) matrix. This example neatly illustrates the power of APL to manipulate arrays.
The second half of the demo illustrates how to write a simple function named mort that can be used to perform this task using different sets of interest rates, loan lengths, and loan amounts. Finally, the document (which in Dyaog is called a workspace) is saved as Mortgage.dws for re-use at a later time. |