HP Forums
Store strings in Matrix - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Store strings in Matrix (/thread-16664.html)



Store strings in Matrix - photometer - 04-16-2021 02:17 AM

Hello all,

I can do L0(1) := "Hello";
However, if I do M0(1,1) := "Hello"; it does not work.
I get an error "Bad argument type".

Can't Matrix be used to store strings?

My intention is to store the Names in first row and numbers in all other rows.


RE: Strore strings in Matrix - rprosperi - 04-16-2021 02:42 AM

(04-16-2021 02:17 AM)photometer Wrote:  Hello all,

I can do L0(1) := "Hello";
However, if I do M0(1,1) := "Hello"; it does not work.
I get an error "Bad argument type".

Can't Matrix be used to store strings?

My intention is to store the Names in first row and numbers in all other rows.

Simple things like this can be easily found in the manual. On page 560, the first page that describes Matrices, it states:

"Matrices are two-dimensional arrays. They are composed of at least two rows and at least one column. Matrices may contain any combination of or real and complex numbers"

The Spreadsheet App may be better for what you are planning, that's described starting on page 222.


RE: Store strings in Matrix - cyrille de brébisson - 04-16-2021 05:32 AM

Hello,

Matrices are mathematical objects which, in home mode, can only store reals or complex numbers.
This allows them to be optimized for speed of mathematics operations.

Lists are collections of objects, of any type.

Cyrille


RE: Store strings in Matrix - photometer - 04-17-2021 03:13 AM

Thanks for clarification.