HP15C Owner's Handbook - Pages 157-159

Description

GSB 6

Cabbages and broccoli are sold. Total weekly weight, total weekly value and the price per kg of each are known.
The program enters the sales data over 3 weeks and outputs the total weights of each vegetable, for each week, in matrix [D]

Inputs
Cabbage $0.24 per kg
Broccoli $0.86 per kg
Store kg and price in [A], a 2x2 matrix

For weeks 1, 2 and 3:
Total weights 274, 233 and 331 kg
Total value $120.32, $112.96 and $151.36
Store weights and value in [B], a 2x3 matrix (2 rows, 3 columns)

Result
In matrix [D] for weeks 1, 2 and 3, a 2x3 matrix
Weight Cabbage 186, 141 and 215 kg
Weight Broccoli 88, 92 and 116 kg

I added some R/S statements in the program after each set of matrix STO statements. They are ignored as they are immediately after the last data entry where a program statement skip automatically occurs. If you don’t use these redundant statements you will get strange results. USER mode during programming allows indexed STO and RCL of matrix elements. The f MATRIX 0 statement is also essential.

Matrices [A], [B] and [D] can be read out by pressing GSB A, B, or D


John Patterson
jepattersonatactrix.co.nz
http://www.jepspectro.com

Program Resources

Labels

Name Description
 A Read the matrix elements in [A]
 B Read the matrix elements in [B]
 D Read the matrix elements in [C]
 6 GSB 6 to run
.1 Matrix [A] readout loop
.2 Matrix [B] readout loop
.4 Matrix [C] readout loop

Flags

Number Description
8 CF8 clear complex flag

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 034 7 7 068 3 3
001 42;21; 6 f LBL 6 035 4 4 069 6 6
002 43; 5; 8 g CF 8 036 u 44 12 USER STO B 070 u 44 12 USER STO B
003 42;16; 0 f MATRIX 0 037 42 31 f PSE 071 31 R/S
004 2 2 038 2 2 072 42 31 f PSE
005 36 ENTER 039 3 3 073 45;16;12 RCL MATRIX B
006 42;23;11 f DIM A 040 3 3 074 42 31 f PSE
007 45;16;11 RCL MATRIX A 041 u 44 12 USER STO B 075 45;16;11 RCL MATRIX A
008 42 31 f PSE 042 42 31 f PSE 076 42 31 f PSE
009 42;16; 1 f MATRIX 1 043 3 3 077 42;26;14 f RESULT D
010 1 1 044 3 3 078 10 ÷
011 u 44 11 USER STO A 045 1 1 079 32 14 GSB D
012 42 31 f PSE 046 u 44 12 USER STO B 080 43 32 g RTN
013 u 44 11 USER STO A 047 42 31 f PSE 081 42;21;11 f LBL A
014 42 31 f PSE 048 1 1 082 42;16; 1 f MATRIX 1
015 48 . 049 2 2 083 42;21; .1 f LBL . 1
016 2 2 050 0 0 084 42 31 f PSE
017 4 4 051 48 . 085 u 45 11 USER RCL A
018 u 44 11 USER STO A 052 3 3 086 22 .1 GTO . 1
019 42 31 f PSE 053 2 2 087 43 32 g RTN
020 48 . 054 u 44 12 USER STO B 088 42;21;12 f LBL B
021 8 8 055 42 31 f PSE 089 42;16; 1 f MATRIX 1
022 6 6 056 1 1 090 42;21; .2 f LBL . 2
023 u 44 11 USER STO A 057 1 1 091 42 31 f PSE
024 31 R/S 058 2 2 092 u 45 12 USER RCL B
025 42 31 f PSE 059 48 . 093 22 .2 GTO . 2
026 2 2 060 9 9 094 43 32 g RTN
027 36 ENTER 061 6 6 095 42;21;14 f LBL D
028 3 3 062 u 44 12 USER STO B 096 42;16; 1 f MATRIX 1
029 42;23;12 f DIM B 063 42 31 f PSE 097 42;21; .4 f LBL . 4
030 45;16;12 RCL MATRIX B 064 1 1 098 42 31 f PSE
031 42 31 f PSE 065 5 5 099 u 45 14 USER RCL D
032 42;16; 1 f MATRIX 1 066 1 1 100 22 .4 GTO . 4
033 2 2 067 48 . 101 43 32 g RTN