HP-71B: Min Max from Row or column in a matrix
01-02-2016, 08:17 AM
Post: #1
 Erwin Member Posts: 139 Joined: May 2015
HP-71B: Min Max from Row or column in a matrix
Hallo!

I posted my question in the wrong forum - thanks Dieter for the hint. So i try to do this in the correct forum again.
I'm looking for a function like in EXCEL to find the MAX, MIN and SUM from a row or column.
I tried to find an easy solution for to find the maximum, the minimum and the sum from rows and columns of a matrix on my HP71b.
There is no build in task in the MAT function and no function in the JPC-ROM too. So the only solution would be to read and compare each cell out of a matrix in BASIC.

Do somebody have a hint for an easy way to do this in Basic or exist there a LEX-function or can help me to solve this problem?

would be great - best regards
Erwin
01-02-2016, 09:26 PM
Post: #2
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: HP-71B: Min Max from Row or column in a matrix
(01-02-2016 08:17 AM)Erwin Wrote:  I tried to find an easy solution for to find the maximum, the minimum and the sum from rows and columns of a matrix on my HP71b.

I am not at all familiar with the HP71's BASIC dialect, so I can't say much about user-defined functions and passing arguments by reference or value, but all this should be easy to do. The following example is some VBA code that calculates the sum of all matrix elements in the 3rd row of matrix A.

Code:
... nrows = ubound(a, 1) ' get number of rows ncols = ubound(a, 2) ' get number of columns row = 3  ' get sum of elements in 3rd row -- usually this is passed as a parameter of a user-defined function sum = 0 for j = 1 to ncols   sum = sum + a(row, j) next rowsum = sum ...

As far as I know the UBOUND function is also available in the 71B Math ROM, it returns the highest index of an array. Of course you would write this as a dedicated function rowsum(matrix, row), but since I don't know much about HP71 BASIC... Here the 71B community will know more.

But all this (including min/max functions) is so simple that I wonder if this really is what you are looking for. ;-)

Dieter
01-05-2016, 07:06 PM
Post: #3
 Valentin Albillo Senior Member Posts: 590 Joined: Feb 2015
RE: HP-71B: Min Max from Row or column in a matrix
.
Hi, Erwin:

(01-02-2016 08:17 AM)Erwin Wrote:  I'm looking for a function like in EXCEL to find the MAX, MIN and SUM from a row or column. I tried to find an easy solution for to find the maximum, the minimum and the sum from rows and columns of a matrix on my HP71b.
[...]
Do somebody have a hint for an easy way to do this in Basic or exist there a LEX-function or can help me to solve this problem?

Have a look at this article of mine (in PDF format) which will probably provide some useful hints in order to accomplish what you want:

HP-71B Math ROM Baker's Dozen (Vol. 1)

Regards.
V.
.

Find All My HP-related Materials here:  Valentin Albillo's HP Collection

01-05-2016, 07:18 PM
Post: #4
 Erwin Member Posts: 139 Joined: May 2015
RE: HP-71B: Min Max from Row or column in a matrix
Hi Valentin!

Thanks for the hint to your article - I know some other useful thongs from you - I use in my work "Minimax Polynomial Fit"

best regards
Erwin

(01-05-2016 07:06 PM)Valentin Albillo Wrote:  .
Hi, Erwin:

(01-02-2016 08:17 AM)Erwin Wrote:  I'm looking for a function like in EXCEL to find the MAX, MIN and SUM from a row or column. I tried to find an easy solution for to find the maximum, the minimum and the sum from rows and columns of a matrix on my HP71b.
[...]
Do somebody have a hint for an easy way to do this in Basic or exist there a LEX-function or can help me to solve this problem?

Have a look at this article of mine (in PDF format) which will probably provide some useful hints in order to accomplish what you want:

HP-71B Math ROM Baker's Dozen (Vol. 1)

Regards.
V.
.
01-05-2016, 09:52 PM
Post: #5
 Thomas Klemm Senior Member Posts: 1,447 Joined: Dec 2013
RE: HP-71B: Min Max from Row or column in a matrix
The Great Figure
Quote:Among the rain
and lights
I saw the figure 5
in gold
on a red
firetruck
moving
tense
unheeded
to gong clangs
siren howls
and wheels rumbling
through the dark city

-- William Carlos Williams
01-05-2016, 10:07 PM
Post: #6
 Massimo Gnerucci Senior Member Posts: 2,070 Joined: Dec 2013
RE: HP-71B: Min Max from Row or column in a matrix
(01-05-2016 09:52 PM)Thomas Klemm Wrote:  The Great Figure
Quote:Among the rain
and lights
I saw the figure 5
in gold
on a red
firetruck
moving
tense
unheeded
to gong clangs
siren howls
and wheels rumbling
through the dark city

-- William Carlos Williams

I Saw the Figure 5 in Gold, by Charles Demuth.

Greetings,
Massimo

-+×÷ ↔ left is right and right is wrong
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)