Rank: 27392 based on 0 downloads (last 30 days) and 0 file submitted
photo

Yuan Ren

E-mail

Personal Profile:
Professional Interests:
Image process, Speech, AI

 

Watch this Author's files

 

Comments and Ratings by Yuan
Updated File Comments Rating
31 Oct 2009 xml_io_tools Read XML files into MATLAB struct and writes MATLAB data types to XML Author: Jaroslaw Tuszynski

I think there's some problem in this part:

digits = '[Inf,NaN,pi,\t,\n,\d,\+,\-,\*,\.,e,i, ,E,I,\[,\],\;,\,]';
s = regexprep(str, digits, ''); % remove all the digits and other allowed characters

I found this when one of my LeafNode called "IN" was recognized as "NaN".

I suggest the following modification.

>> regexprep('IN','[Inf,NaN]','')

ans =

''

>> regexprep('IN','(Inf)|(NaN)','')

ans =

IN

One other thing is "num = str2num(str)" is a somewhat dangerous function. I'm not sure if it worth it to use this to provide some fancy functionality.

Contact us