Ignore:
Timestamp:
Feb 7, 2026, 9:25:13 PM (2 weeks ago)
Author:
sommeria
Message:

error corrected in xml2struct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/xml2struct.m

    r1191 r1192  
    8686    case 'char'
    8787            out=str2double(strsplit(ss));% convert to number or vector (str2num applied to a fct name executes this fct by 'eval', thus this possibility had to be ruled out above
    88             if isnan(out)
     88            if find(isnan(out))
    8989                sep_ind=regexp(ss,'\s&\s');% check for separator ' & ' which indicates column separation in tables
    9090                if ~isempty(sep_ind)
     
    102102        check_numeric=zeros(size(ss));
    103103        for ilist=1:numel(ss)
    104             if  ~isnan(str2double(strsplit(ss{ilist})))
    105                 out{ilist,1}=str2double(strsplit(ss{ilist}));
    106                 check_numeric(ilist)=1;
    107             else
     104            if  find(isnan(str2double(strsplit(ss{ilist}))))
    108105                sep_ind=regexp(ss{ilist},'\s&\s');% check for separator ' & ' which indicates column separation in tables
    109106                if ~isempty(sep_ind)
     
    115112                    out{ilist,1}=ss{ilist}; %reproduce the input string
    116113                end
     114            else
     115                out{ilist,1}=str2double(strsplit(ss{ilist}));
     116                check_numeric(ilist)=1;
    117117            end
    118118        end
Note: See TracChangeset for help on using the changeset viewer.