Navigation

Operators and Keywords

Function List:

C++ API

num2str.m File Reference


Functions

endif if (ischar(x)) retval
 elseif (isempty(x)) retval
 elseif (iscomplex(x)) if(nargin
else if (isnumeric(x)&&round(x)==x &&abs(x)< (10.^arg)) fmt
 if (length(abs(x)==x) > 0) fmt
endif elseif (isscalar(x)) fmt = "%11.5g"
 perm (2:2:2 *nc)
 while (true) tmp2
 if (length(tmp)==length(tmp2)) break
 if (tmp==tmp2) break
endif endwhile tmp (length(tmp))
else if (nargin==2) if(ischar(arg)) fmt
endif endfunction !assert ((strcmp(num2str(123),"123")&&strcmp(num2str(1.23),"1.23")))
 !assert (num2str(123.456, 4),"123.5")
 !assert (all(num2str([1, 1.34;3, 3.56],"%5.1f")==["1.0 1.3";"3.0 3.6"]))
 !assert (num2str(1.234+27.3i),"1.234+27.3i")
!error num2str ()
!error num2str (1, 2, 3)

Variables

function retval
else fmt = sprintf ("%%%d.%dg%%-+%d.%dgi", arg+7, arg, arg+7, arg)
endif endif else if(isnumeric(x)&&round(x)==x
&&abs(x)< 1e10) if(max(abs(real(x(else 
dgt1
endif dgt2 = dgt1 - (min (real (x(:))) >= 0)
endif endif sz = size (x)
 nc = sz(2)
 nd = ndims (x)
 perm = fix ([1:0.5:nc+0.5])
 idx = cell ()
for i
 x = horzcat (real (x), imag (x))
 tmp = sprintf (fmt, permute (x, [2, 1, 3:nd]))
endif endif else if(isnumeric(x)&&round(x)==x
&&abs(x)< 1e10) if(max(abs(x(else 
dgt = floor (log10 (max (abs(x(:))))) + (min (real (x(:))) < 0) + 2

Function Documentation

!assert ( num2str(1.234+27.3i)  ,
"1.234+27.3i"   
)

!assert ( all(num2str([1, 1.34;3, 3.56],"%5.1f")==["1.0 1.3";"3.0 3.6"])   ) 

!assert ( num2str(123.456, 4)  ,
"123.5"   
)

endif endfunction !assert ( (strcmp(num2str(123),"123")&&strcmp(num2str(1.23),"1.23"))   ) 

endif elseif ( isscalar(x)   )  = "%11.5g"

elseif ( iscomplex(x)   ) 

elseif ( isempty(x)   ) 

else if ( nargin  = =2  ) 

if ( tmp  = =tmp2  ) 

if ( length(tmp)  = =length(tmp2)  ) 

if ( length(abs(x)==x)  ,
 
)

else if (  ) 

endif if ( ischar(x)   ) 

!error num2str ( ,
,
 
)

!error num2str (  ) 

perm ( 2:2:2 *  nc  ) 

endif endwhile tmp ( length(tmp)   ) 

while ( true   ) 


Variable Documentation

endif endif else if (isnumeric (x) && round (x) == x && abs (x) < 1e10) if (max (abs (x( else dgt = floor (log10 (max (abs(x(:))))) + (min (real (x(:))) < 0) + 2

endif endif else if (isnumeric (x) && round (x) == x && abs (x) < 1e10) if (max (abs (real (x( else dgt1

Initial value:

 ceil (log10 (max (max (abs (real (x(:)))),
                                   max (abs (imag (x(:))))))) + 2

endif dgt2 = dgt1 - (min (real (x(:))) >= 0)

endif endif fmt = sprintf ("%%%d.%dg%%-+%d.%dgi", arg+7, arg, arg+7, arg)

for i

Initial value:

 1:nd
      idx{i} = 1:sz(i)

idx = cell ()

nc = sz(2)

nd = ndims (x)

perm = fix ([1:0.5:nc+0.5])

retval

Initial value:

 num2str (x, arg)

  if (nargin != 1 && nargin != 2)
    print_usage ()

endif endif sz = size (x)

tmp = sprintf (fmt, permute (x, [2, 1, 3:nd]))

x = horzcat (real (x), imag (x))