#NEWLINE# def FCgetMatlabSequence( a ) : #NEWLINE# #INDENT# if ( len ( a ) == 1 ) : #NEWLINE# #INDENT# return ( a [ 0 ] + '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( a ) == 2 ) : #NEWLINE# #INDENT# return ( ( a [ 0 ] + ',' ) + a [ 1 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# step = ( a [ 1 ] - a [ 0 ] ) #NEWLINE# isConstantStep = True #NEWLINE# for i in range ( 1 , ( len ( a ) - 2 ) ) : #NEWLINE# #INDENT# if ( abs ( ( ( a [ ( i + 1 ) ] - a [ i ] ) - step ) ) > 1e-10 ) : #NEWLINE# #INDENT# isConstantStep = False #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# if isConstantStep : #NEWLINE# #INDENT# return ( ( ( ( a [ 0 ] + ':' ) + step ) + ':' ) + a [ ( len ( a ) - 1 ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = '' #NEWLINE# for i in range ( 1 , len ( a ) ) : #NEWLINE# #INDENT# if ( len ( result ) > 0 ) : #NEWLINE# #INDENT# result = ( result + ',' ) #NEWLINE# #UNINDENT# result = ( result + a [ i ] ) #NEWLINE# #UNINDENT# return result