# HP Forums

Full Version: problem with table and seq data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.

TABLES and SEQUENCES have been present since the beginning of hp-prime, but there is a problem when creating tables because the position (a, b) is rewritten to the algebraic form of a complex number a+b*i

Steps to reproduce the problem.

PHP Code:
`1: mtr1 := [[ 9, 0 ],[ 0, 6 ]] [enter] ok2: tbl2 := table( mtr1 .+ 1 )  [enter] ok >table(   (1,1) = 10,   (1,2) = 1,   (2,1) = 1,   (2,2) = 7) `

tbl3 := [up] [copy] [enter]

PHP Code:
`tbl3 := table(   1+i = 10,   1+2*i = 1,   2+i = 1,   2+2*i = 7) `

matrix( tbl2 ) [enter] ok >
[[ 10, 1 ],[ 1, 7 ]]

matrix( tbl3 ) [enter] >

"matrix( tbl3 )

I think a solution is that the tables are encoded the positions of the elements with [[x, y]] or [x,y] and not as (x, y)

/!\
[[x, y]] index in 1
[x,y] index in 0

tbl2 := table( mtr1 .+ 1 ) [enter] >

PHP Code:
`table(   [[1,1]] = 10,   [[1,2]] = 1,   [[2,1]] = 1,   [[2,2]] = 7) `

or

PHP Code:
`table(   [0,0] = 10,   [0,1] = 1,   [1,0] = 1,   [1,1] = 7) `

/////
Now with seq cmd

seq1:= 9,8,7 [enter] ok >
seq1[] [enter] ok
7

[up] [copy] [enter] >
"Gen [int] Error: Bad Argument Type"

seq1 [enter] // index in 0
8 > 7

test on-line
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :