Re: HP49G+ Message #2 Posted by Valentin Albillo on 10 Nov 2005, 5:46 a.m., in response to message #1 by Chris Dean
Hi, Chris:
Chris wrote:
"I noticed in the principal features on the HPCC site that the HP49G series calculators are programmable in HP Basic.
[...]
Is this true?
If you call code like this "HP BASIC":
FOR(i,1,100)
DISP(i,1);
IF I+1-5==50 THEN DISP("Hello World",2) ELSE DISP("I'm off",2) END
STEP(1)
then, yes. Else, no.
There are, however, very good emulators available for the 48/49 series that can provide the goods. For instance, HP-71X by Hrastprogrammer does perfectly emulate an HP-71B, and this allows you to program in HP-71B BASIC, which is an advanced version of the usual 'technical' BASIC dialect found in larger, vintage HP computers of old, such as the HP-85, HP-86/87, or HP-75, say.
Using this emulator would allow you to write and run code like this:
10 DESTROY ALL @ OPTION BASE 1 @ INPUT "#Points, Degree=";N,D
20 DIM X(N),Y(N),A(D+1) @ MAT INPUT X,Y @ CALL LSP(X,Y,A) @ MAT DISP A @ END
30 SUB LSP(X(),Y(),A()) @ N=UBND(X,1) @ D=UBND(A,1) @ DIM U(N,D),V(D)
40 MAT U=CON @ FOR I=1 TO N @ FOR J=2 TO D @ U(I,J)=X(I)^(J-1) @ NEXT J
50 NEXT I @ MAT V=TRN(U)*Y @ MAT U=TRN(U)*U @ MAT A=SYS(U,V) @ END SUB
which, by the way, is a little program I wrote to compute the coefficients of the Nth-degree least squares polynomial regression to an arbitrary set of datapoints (X,Y).
Thus, by using HP-71X you can develop/run similar code in this powerful version of HP Technical BASIC on your 48/49.
Best regards from V.
Edited: 10 Nov 2005, 6:00 a.m.
|