Hi, Glynn;
just to add a few more data.
Based on what both Thibaut and Valentin posted, you can summarize these facts:
- the maximum number of registers in an HP15C is 67;
- only 64 of them can be used in matrices, because RI, R0 and R1 will be always RI, R0 and R1;
As Valentin mentioned, you can store up to 67 numbers, but only if you have less than 64 you'll have space for a program or routine; RI, R0 and R1 cannot be converted into program steps.
You can create matrices with valid dimensions starting with [64 × 1] to [1 ×64] and with any other [# of rows × # of columns], provided that # of rows × # of columns <= 64.
If you find a suitable arrangement, defined by an specific # of "products" and related # of items/product, you define the matrix DIMension directly like this:
# of "products" [ENTER] # of items/product [f][DIM] { [A] to [E] }
The { [A] to [E] } means you can choose which one is better for you. Maybe [f][DIM] [C] suggests Costs, who knows?
You can fill the matrix as a sequence of linear data, starting with C (1,1) to C (r,c), being (r,c) the indexes for the last element in the matrix. Considering r as # of rows, c as # of columns and [C] as the matrix you are going to use to store your data, follow these steps to create the matrix and store data on it:
(1) [f][MATRIX] 0 (or [ON]/[-] to clear all memory)
(2) r [ENTER] c [f][DIM] [C]
(3) [f][MATRIX] 1
(4) [f][USER] (to activate USER mode)
(5) enter first data
(6) [STO] [C] (shows element indexes while [C] key is held down)
(7) enter next data
(8) back to step (6) till last data
Obs: [f][MATRIX] 0 clears all existing matrices, if any, and frees their space to new data; [f][MATRIX] 1 stores 1 in R0 and R1, "initializing" matrix index, as explained right below; USER mode is activated to allow automatic "index update" (increasingly) each time [STO] {[A] to [E]} (or [RCL] {[A] to [E]}) is pressed.
Alternatively, you can use a non-sequential way to enter data that is almost the same one used to recall them non-sequentially. This method uses two stack registers contents - Y and X - as indexes for (r,c). When using sequential access, R0 and R1 are used as indexes, i.e., element C (r,c) is, in fact, C (R0, R1). If you want, you can access C (r,c) using stack registers and the element would be C (Y,X). This is accomplished with the sequences [RCL] [g]{ [A] to [E] } and [STO] [g] { [A] to [E] }. Assume you are still working with matrix C and it was defined with ten products and 5 items for each product. To create this matrix you should use:
10 [ENTER] 5 [f][DIM] [C]
After you fill it with all data, let's suppose you want to add the first and the fourth elements in the third row. To recall each of them and add their values, you should do this:
(1) 3 [ENTER] 1
(2) [RCL][g] [C] ([C 3,1 ] is briefly shown)
(3) 3 [ENTER] 4
(4) [RCL][g] [C] ([C 3,4 ] is briefly shown)
(5) [+]
Step (1) defines row # 3 and column # 1 as indexes;
step (2) recalls C (3,1) (or C (Y,X)) to the stack;
step (3) defines row # 3 and column # 4 as indexes; note that previously recalled value is now in Z-register;
step (4) recalls C (3,4) to the stack; now you have C (3,1) and C (3,4) in Y and X registers, respectively;
step (5) adds them both.
I hope this helps you a bit. If I forgot anything and you cannot do it, please, let us know. I wrote this all by heart, maybe there are errors.
Success.
Luiz (Brazil)
Edited: 17 July 2003, 7:22 a.m.