HP 12C#ABA hp 12c_solutions handbook_English_E.pdf - Page 75

corresponding to the number of elements you are using. For, lines 35 through 39 - reset

Page 75 highlights

m* 01 37- 31 38- 44 -- 39-43, 33 01 n: Unused PV: Unused FV: Unused R1: X1 R3: X3 R5: X5 R7: X7 R9: X9 R.1: X11 R.3-R.4: Unused REGISTERS i: Unused PMT: Unused R0: m R2: X2 R4: X4 R6: X6 R8: X8 R.0: X.0 R.2: X12 *At step 38, m=number of elements in the moving average, i.e. fir a 5 element moving average line 38 would be 5 and for a 12-element average line 38 would be 2 This program can be used for a moving average of 2 to 12 elements. It may be shortened considerably for moving averages with less than 12 elements. To do this, key in the program, as shown, form line 01 until you reach a superscripted with the number of elements you desire. Key in this line, then skip the reset of the program down to line 35. Then key in lines 35 through 39, being sure to specify the register number at line 38, m, corresponding to the number of elements you are using. (For instance, for a 5 element moving average, key in lines 01 through 13 then go to line 35 in the listing and key in the balance of the program. Obviously the program listing line 38, m becomes the displayed line 17, 5). To run the program: 1. Key in the program. 2. Press CLEAR . Key in the number of elements, m, and press 0. 3. Key in the second data point and press 1. 4. Key in the second data point and press 2. 74

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165

74
*At step 38,
m
=number of elements in the moving average, i.e. fir a 5
element moving average line 38 would be
5 and for a 12-element
average line 38 would be
2
This program can be used for a moving average of 2 to 12 elements. It
may be shortened considerably for moving averages with less than 12
elements. To do this, key in the program, as shown, form line 01 until you
reach a
superscripted with the number of elements you desire. Key in
this line, then skip the reset of the program down to line 35. Then key in
lines 35 through 39, being sure to specify the register number at line 38,
m
, corresponding to the number of elements you are using. (For
instance, for a 5 element moving average, key in lines 01 through 13 then
go to line 35 in the listing and key in the balance of the program. Obviously
the program listing line 38,
m
becomes the displayed line 17,
5).
To run the program:
1.
Key in the program.
2.
Press
CLEAR
. Key in the number of elements,
m
, and press 0.
3.
Key in the second data point and press
1.
4.
Key in the second data point and press
2.
37-
31
m*
38-
44 --
01
39-43, 33 01
REGISTERS
n: Unused
i: Unused
PV: Unused
PMT: Unused
FV: Unused
R
0
:
m
R
1
:
X
1
R
2
:
X
2
R
3
:
X
3
R
4
:
X
4
R
5
:
X
5
R
6
:
X
6
R
7
:
X
7
R
8
:
X
8
R
9
:
X
9
R
.0
:
X
.0
R
.1
:
X
11
R
.2
:
X
12
R
.3
-R
.4
: Unused