[Scilab-users] Number to string with padding of leading blanks by a set of characters

Samuel Gougeon sgougeon at free.fr
Sun Aug 28 16:32:21 CEST 2016


Le 28/08/2016 16:17, Jens Simon Strom a écrit :
> Hello,
> I try to  transform the number colum N containing integer elements 
> from 1 to 999, e. g.
>
> N=[1;11;111]
>
> into
>
> T=["  1";" 11";"111"].
>
> I tried with commands like justify, repmat, string, size, length - but 
> without success. Do I miss one or more better adequate command(s)?
Like this? :
--> strsubst(justify(string(N),"r")," "," ")
  ans  =

!  1  !
!               !
! 11       !
!               !
!111            !





More information about the users mailing list