cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
ram
ram
Level IV

JSL List to matrix ?

Prob: needed to get a list or matrix of numbers instead of characters;

 

String="1,2,3,4,5,6";

list=words(String,",");  //output --> {"1","2","3","4","5","6"}

 

required output ={1,2,3,4,5,6};

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: JSL List to matrix ?

All Matrix, List and Character functions are available at

     Help==>Scripting Index==>Functions

Here is a possible answer for you

Names Default To Here( 1 );
String = "1,2,3,4,5,6";
Eval( Parse( "Mat=[" || string || "];" ) );
Jim

View solution in original post

4 REPLIES 4
ram
ram
Level IV

Re: JSL List to matrix ?

No For loop should be used.
Jeff_Perkinson
Community Manager Community Manager

Re: JSL List to matrix ?

Here's one way to do it without a For() loop.

 

String="1,2,3,4,5,6";
list=words(String,",");  
//output --> {"1","2","3","4","5","6"}

x=new table("temp", new column("c", character, values(list)), private);
:c<< data type(numeric);
m = c<< get values;

close(x, nosave);

show(m);
-Jeff
txnelson
Super User

Re: JSL List to matrix ?

All Matrix, List and Character functions are available at

     Help==>Scripting Index==>Functions

Here is a possible answer for you

Names Default To Here( 1 );
String = "1,2,3,4,5,6";
Eval( Parse( "Mat=[" || string || "];" ) );
Jim
ram
ram
Level IV

Re: JSL List to matrix ?

Thank you Jim,
This is exactly i was looking for. Also Thanks for pointing to the link to explore other functions too.

Recommended Articles