Navigation

Operators and Keywords

Function List:

C++ API

str2num.m File Reference


Functions

 eval (s,"m = [];")
 if (ischar(m)) m
endif else print_usage ()
endif endfunction !assert (str2num("-1.3e2")==-130 &&str2num("[1, 2; 3, 4]")==[1, 2;3, 4])
!error str2num ()
!error str2num ("string", 1)

Variables

function m
 sep = ";"
 s = sprintf ("m = [%s];", reshape ([s, sep]', 1, nr * (nc + 1)))

Function Documentation

endif endfunction !assert ( str2num("-1.3e2")  = =-130 &&str2num("[1, 2; 3, 4]")==[1,
2;  3,
4]   
)

eval (  ) 

if ( ischar(m)   ) 

endif else print_usage (  ) 

!error str2num ( "string"  ,
 
)

!error str2num (  ) 


Variable Documentation

Initial value:

 str2num (s)

  if (nargin == 1 && ischar (s))
    [nr, nc] = size (s)

s = sprintf ("m = [%s];", reshape ([s, sep]', 1, nr * (nc + 1)))

sep = ";"