The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Programming a Matrix(hp49G+) ?
Message #1 Posted by Barry on 9 June 2004, 9:18 a.m.

Hi

I would like to take a value from the stack place it into a matrix, and get an ouput value.

I have tried << -> x '[[cos(x),sin(x)][sin(x),cos(x)]]'>> I get a "bad argument error' Normal equation work.

Does anyone know how to do this?

Thanks

Barry

      
Re: Programming a Matrix(hp49G+) ?
Message #2 Posted by Vieira, Luiz C. (Brazil) on 9 June 2004, 9:55 a.m.,
in response to message #1 by Barry

Hi, Barry;

I remember that till the HP48, all arguments possible in an array are numbers, even complex (not sure if bunaries are allowed as well... I think not). I don't recall having algebraics as array "arguments".

anyway, you can arrange your expressions in lists and disassemble/reassemble: turn lists into arrays. If I am not wrogn, the HP49G+ has some new features for this.

Also, having the expressions organized in lists, like

{{cos(x) sin(x)}{sin(x) cos(x)}}
allows you to use a handy command: DOLISTS (also DOSUBS may help, depending on what you want).

I guess SYS RPL guys may have other possibilities. I'm starting to read about SYS RPL, and there are many interesting things there... It's a new world.

Hope you succeed. If not, post again.

Cheers.

Luiz (Brazil)

      
Re: Programming a Matrix(hp49G+) ?
Message #3 Posted by Vepa on 9 June 2004, 9:56 a.m.,
in response to message #1 by Barry

<< -> x '[[cos(x),sin(x)][sin(x),cos(x)]]'>>
 I get a "bad argument error' Normal equation work.

You need an ALGebraic side trick: << -> x << `[[COS(x),SIN(x)] [SIN(x),COS(x)]]` >> >> BYTES # 917Bh 92.5 `[V,P,N]`

            
Re: Programming a Matrix(hp49G+) ?
Message #4 Posted by Veli-Pekka Nousiainen on 9 June 2004, 10:03 a.m.,
in response to message #3 by Vepa

You could also use a pure RPN program:
<< -> x <<
[[ 'COS(X)' 'SIN(X)' ]
 [ 'SIN(X)' 'COS(X)' ]] 'X' x
= SUBST ->NUM >> >>
BYTES # D351h  109.5

You may leave the ->NUM away if you want to do it manually. [V P N]


[ Return to Index | Top of Index ]

Go back to the main exhibit hall