The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

How to import a matrix from a PC into the HP48?
Message #1 Posted by Dia C. Tran on 31 Aug 2006, 3:41 p.m.

I have some data on the PC as text file. I want to import the data into the HP48 (I have an SX and a GX as well as the emu48) in the form of a 2 column matrix so that I can run the regression on. What format the data must be in so that once transfered to the 48 it would recognize as a matrix?

Edited: 31 Aug 2006, 4:43 p.m. after one or more responses were posted

      
Re: How to import a matrix from a PC into the HP48?
Message #2 Posted by Christoph Giesselink on 31 Aug 2006, 4:36 p.m.,
in response to message #1 by Dia C. Tran

Quote:
I have some data on the PC as text file. I want to import the data into the HP48 (I have an SX and a GX as well as the emu48) in the form of a 2 column matrix so that I can run the progression on. What format the data must be in so that once transfered to the 48 it would recognized as a matrix?

Mostly every string in HP48 matrix format is accepted by Emu48.

Sample:

[ [ 1 2 ]
[3    4] ]

can be imported by Copy&Paste (Edit/Paste Stack) or with the Edit/Load Object... as string into stack Level 1. A simple OBJ-> on the calculator converts this into a Matrix object.

Christoph

      
Re: How to import a matrix from a PC into the HP48?
Message #3 Posted by Marcus von Cube, Germany on 1 Sept 2006, 4:10 a.m.,
in response to message #1 by Dia C. Tran

I exported a matrix from my 50g to the PC using Conn4x and this is the result:

%%HP: T(3)A(R)F(.);
[[ 1 2 ]
 [ 3 4 ]]

So if you can create such a file from your data, you are fine.

Marcus

            
Re: How to import a matrix from a PC into the HP48?
Message #4 Posted by James M. Prange (Michigan) on 1 Sept 2006, 4:50 a.m.,
in response to message #3 by Marcus von Cube, Germany

Quote:
I exported a matrix from my 50g to the PC using Conn4x and this is the result:

%%HP: T(3)A(R)F(.);
[[ 1 2 ]
 [ 3 4 ]]

So if you can create such a file from your data, you are fine.


Note that if the data includes any "decimal point", for the ASCII transfer header, use F(.) if the "fraction mark" is a period, or F(,) if the fraction mark is a comma.

For that matter, if you omit the transfer header, then the calculator will store the entire data stream as a character string, which you could recall to the stack and "execute" with STR\-> or OBJ-> to get the matrix.

For more information on transfer headers, search from http://groups.google.com/group/comp.sys.hp48.

For the 49 series, numbers without decimal points are compiled as "exact integers" if the calculator is in "exact" mode, or "real numbers" if the calculator is in "approximate" mode.

But I do prefer Cristoph's suggestion of using Emu48 to work with data that's available on the PC, rather than transferring it to a physical calculator.

Regards,
James

                  
Re: How to import a matrix from a PC into the HP48?
Message #5 Posted by Dia C. Tran on 1 Sept 2006, 7:21 a.m.,
in response to message #4 by James M. Prange (Michigan)

Thanks everyone! I followed Christoph instructions and it worked fine.

      
Re: How to import a matrix from a PC into the HP48?
Message #6 Posted by Karl-Ludwig Butte on 1 Sept 2006, 3:42 a.m.,
in response to message #1 by Dia C. Tran

Hello,

there is an Excel-AddIn for transfering data between an HP-48/49 and Microsoft Excel 97 and higher over at hpcalc.org (http://www.hpcalc.org/details.php?id=5166). I've tested it with a 49g and it works perfectly.

Hope that helps.

Regards

Karl


[ Return to Index | Top of Index ]

Go back to the main exhibit hall