Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
Benson
Level II

How to Get as Matrix

I am wondering if anyone knew how to get as matrix with specific row.

 

For example, I would like to get as matrix with row(1),

mat will be [12 59 95].

Names Default To Here( 1 );
bigclass=Open( "$SAMPLE_DATA/Big Class.jmp" );
mat = bigclass << GetAsMatrix({2,3::5});
Show(mat);

mat =
[ 12 59 95,
 12 61 123,
 12 55 74,
 12 66 145,
 12 52 64,
 12 60 84,
 12 61 128,
 12 51 79,
 13 60 112,
 13 61 107,
 13 56 67,
 13 65 98,
 13 63 105,
 13 58 95,
 13 59 79,
 14 61 81,
 14 62 91,
 14 65 142,
 14 63 84,
 14 62 85,
 14 63 93,
 14 64 99,
 14 65 119,
 14 64 92,
 14 68 112,
 14 64 99,
 14 69 113,
 15 62 92,
 15 64 112,
 15 67 128,
 15 65 111,
 15 66 105,
 15 62 104,
 15 66 106,
 16 65 112,
 16 60 115,
 16 68 128,
 17 62 116,
 17 68 134,
 17 70 172];

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
txnelson
Super User

Re: How to Get as Matrix

Here is one way to do this:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << delete columns( {name, sex} );
valueMatrix = dt[1, 0];

Show( valueMatrix );
Jim

View solution in original post

Highlighted
ian_jmp
Staff

Re: How to Get as Matrix

Depending on what else you are doing, you could also use data table subscripting:

mat2 = bigclass[1, {2, 4, 5}]

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: How to Get as Matrix

Here is one way to do this:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << delete columns( {name, sex} );
valueMatrix = dt[1, 0];

Show( valueMatrix );
Jim

View solution in original post

Highlighted
ian_jmp
Staff

Re: How to Get as Matrix

Depending on what else you are doing, you could also use data table subscripting:

mat2 = bigclass[1, {2, 4, 5}]

View solution in original post

Article Labels

    There are no labels assigned to this post.