Mercurial > forge
changeset 1675:cf43855fa70b octave-forge
returns a cell array of strings as 3rd argout; use of more specific EXIST improves performance
author | schloegl |
---|---|
date | Wed, 01 Sep 2004 13:49:18 +0000 |
parents | 73f39a79b1cd |
children | 075a6c2ce07e |
files | main/strings/str2double.m |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/main/strings/str2double.m Wed Sep 01 08:52:24 2004 +0000 +++ b/main/strings/str2double.m Wed Sep 01 13:49:18 2004 +0000 @@ -1,6 +1,6 @@ function [num,status,strarray] = str2double(s,cdelim,rdelim,ddelim) %% STR2DOUBLE converts strings into numeric values -%% [NUM, STATUS] = STR2DOUBLE(STR) +%% [NUM, STATUS,STRARRAY] = STR2DOUBLE(STR) %% %% STR2DOUBLE can replace STR2NUM, but avoids the insecure use of EVAL %% on unknown data [1]. @@ -10,7 +10,8 @@ %% NUM is the corresponding numeric value. %% if the conversion fails, status is -1 and NUM is NaN. %% STATUS = 0: conversion was successful -%% STATUS = -1: couldnot convert string into numeric value +%% STATUS = -1: couldnot convert string into numeric value +%% STRARRAY is a cell array of strings. %% %% Elements which are not defined or not valid return NaN and %% the STATUS becomes -1 @@ -73,7 +74,7 @@ %% Copyright (C) 2004 by Alois Schloegl <a.schloegl@ieee.org> %% This function is part of Octave-Forge http://octave.sourceforge.net/ -FLAG_OCTAVE = exist('OCTAVE_VERSION'); +FLAG_OCTAVE = exist('OCTAVE_VERSION','builtin'); % valid_char = '0123456789eE+-.nNaAiIfF'; % digits, sign, exponent,NaN,Inf valid_delim = char(sort([0,9:14,32:34,abs('()[]{},;:"|/')])); % valid delimiter