convert( ) cmd

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 554
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

convert( ) cmd

Message par compsystems » jeu. févr. 06, 2020 9:18 pm

Hello

A SEQUENCE is transformed into VECTOR with the order nop()
nop( 1, 2, 3) [↵] returns [1, 2, 3]

A VECTOR / LIST / SET / POLYNOMY / MATRIX is transformed into SEQUENCE with the op() cmd

op( [ 1 ,2, 3 ] ) [↵] returns ( 1 ,2, 3 )
op( list[ 1 ,2, 3 ] ) [↵] returns ( 1 ,2, 3 )
op( set[ 1 ,2, 3 ] ) [↵] returns( 1 ,2, 3 )
op( poly1[ 1 ,2, 3 ] ) [↵] returns( 1 ,2, 3 )
op( matrix[[ 1 ,2, 3 ], [ 4, 5, 6 ]] ) [↵] returns a sequence of vectors ( [ 1 ,2, 3 ], [ 4, 5, 6 ] )

you need to complete the option of the convert command to sequence,
since it is easier to remember the name convert() than op()

convert( [ 1, 2, 3 ], 'seq' ) -> ( 1 ,2, 3 )
convert( list[ 1 ,2, 3 ], seq ) -> ( 1 ,2, 3 )
convert( set[ 1 ,2, 3 ], seq ) -> ( 1 ,2, 3 )
convert( poly1[ 1 ,2, 3 ], seq ) -> ( 1 ,2, 3 )
convert( matrix[[ 1 ,2, 3 ], [ 4, 5, 6 ]], seq ) -> ( [ 1 ,2, 3 ], [ 4, 5, 6 ] )

parisse
Messages : 5731
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: convert( ) cmd

Message par parisse » ven. févr. 07, 2020 12:12 pm

OK, I'll add convert(.,seq).

compsystems
Messages : 554
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: convert( ) cmd

Message par compsystems » dim. mai 24, 2020 5:40 pm

on Xcas 1.60-1
convert( matrix[[ 1 ,2, 3 ], [ 4, 5, 6 ]], seq ) -> [1,2,3],[4,5,6] ok
Thanks

Répondre