# HG changeset patch # User Rik # Date 1314912991 25200 # Node ID 8abb190e6cc82d02e79e1bb129c5e6188ee75034 # Parent fa0827db4d5de6f8cf32c82cfe43a6a72be182d8 doc: Improve strnum() docstring str2num.m: Correctly refer to output X, not N. More emphatically recommend using str2double a replacement. Adjust example to use Octave coding standards for spacing. diff -r fa0827db4d5d -r 8abb190e6cc8 scripts/strings/str2num.m --- a/scripts/strings/str2num.m Thu Sep 01 12:18:09 2011 -0400 +++ b/scripts/strings/str2num.m Thu Sep 01 14:36:31 2011 -0700 @@ -24,24 +24,24 @@ ## ## @example ## @group -## str2num("3.141596") -## @result{} 3.141596 +## str2num ("3.141596") +## @result{} 3.141596 ## -## str2num(["1, 2, 3"; "4, 5, 6"]); -## @result{} ans = -## 1 2 3 -## 4 5 6 +## str2num (["1, 2, 3"; "4, 5, 6"]); +## @result{} ans = +## 1 2 3 +## 4 5 6 ## @end group ## @end example ## ## The optional second output, @var{state}, is logically true when the ## coversion is successful. If the conversion fails the numeric output, -## @var{n}, is empty and @var{state} is false. +## @var{x}, is empty and @var{state} is false. ## ## @strong{Caution:} As @code{str2num} uses the @code{eval} function ## to do the conversion, @code{str2num} will execute any code contained -## in the string @var{s}. Use @code{str2double} instead if you want to -## avoid the use of @code{eval}. +## in the string @var{s}. Use @code{str2double} for a safer and faster +## conversion. ## @seealso{str2double, eval} ## @end deftypefn