cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
nikles
Level VI

save matrix as table variable?

Hi.  I'm wondering if it is possible to save a matrix or list to a table as a variable, as in:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Table Variable("Day_mat", [42 43]);

This did not work of course, but is there another way?  One option I'm considering is saving it as a table script instead, as in:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Script("Dat_mat_script", Day_mat = [42 43]);

Just wondering if the community has a better idea?  Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: save matrix as table variable?

I think the table variable has to be either text or numeric value -> you can save it if you convert it into a string (use Char() to convert and Parse() when you need to use it)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Table Variable("Day_mat", Char([42 43]));

m = Parse(:Day_mat);
-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: save matrix as table variable?

I think the table variable has to be either text or numeric value -> you can save it if you convert it into a string (use Char() to convert and Parse() when you need to use it)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Table Variable("Day_mat", Char([42 43]));

m = Parse(:Day_mat);
-Jarmo
hogi
Level XI

Re: save matrix as table variable?

nice workaround

Yes, interesting why there is this restriction for Table variables.

Seems that at the time when Matrices and Lists were introduced in Jmp, development forgot to enable it for table variable.

 

It could also be intentional that this feature was not added - perhaps to facilitate the input:
if it's no number, it's a string

to allow typing strings without " ..."

 

If somebody writes a wish list entry, I will support it with a Kudo

jthi
Super User

Re: save matrix as table variable?

I think Table Variables have specific use and that is why they only support text or values (numeric) Using JMP > Enter and Edit Your Data > Edit Data Tables > Use Data Table Variables , but most likely it could be worth a revisit to allow using at least lists, matrices and associative arrays. I can make a wish list item, though I think JMP development isn't able to keep up to date with them at all currently (we have almost 600 "new" wish list items). 

 

(Created this while writing this post)... Here is the wish list item Let us use more complicated data types for table variables than just text and numbers 

-Jarmo
hogi
Level XI

Re: save matrix as table variable?


@jthi wrote:

we have almost 600 "new" wish list items


Yes, seems that since ~ end of 2022 just a small part of the new wishes got acknowledged.

 

I guess this is due to rfinal phase of Jmp18 development.

Let's hope that after the release of Jmp18 they will start again to acknowledge the new wishes and transfer the good ones to investigating and delivered ....

nikles
Level VI

Re: save matrix as table variable?

Thanks @jthi. I like this idea too.