Changeset 663 for trunk/src/xml2struct.m


Ignore:
Timestamp:
Jul 11, 2013, 6:45:32 PM (11 years ago)
Author:
sommeria
Message:

bug corrected again in xml2struct, PLOT and copy of points improved in geometry_calib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/xml2struct.m

    r662 r663  
    4646            out.(names{k})=convert_string(ss.(names{k}));
    4747        end
    48     case 'char'   
    49         out=str2double(ss);
    50         %if isempty(regexp(ss,'^(-*\d+\.*\d*\ *)+$'))% if the string does not contain a set of numbers (with possible sign and decimal) separated by blanks
    51         if isnan(out)
    52             sep_ind=regexp(ss,'\s&\s');% check for separator ' & ' which indicates column separation in tables
    53             if ~isempty(sep_ind)
    54                 sep_ind=[-2 sep_ind length(ss)+1];
    55                 for icolumn=1:length(sep_ind)-1
    56                     out{1,icolumn}=ss(sep_ind(icolumn)+3:sep_ind(icolumn+1)-1);
     48    case 'char'
     49        out=ss; %reproduce the input string
     50        if ~strcmp(ss,'image')% bug with Matlab str2num('image')-> child face
     51            out=str2num(ss);
     52            %if isempty(regexp(ss,'^(-*\d+\.*\d*\ *)+$'))% if the string does not contain a set of numbers (with possible sign and decimal) separated by blanks
     53            if isempty(out)
     54                sep_ind=regexp(ss,'\s&\s');% check for separator ' & ' which indicates column separation in tables
     55                if ~isempty(sep_ind)
     56                    sep_ind=[-2 sep_ind length(ss)+1];
     57                    for icolumn=1:length(sep_ind)-1
     58                        out{1,icolumn}=ss(sep_ind(icolumn)+3:sep_ind(icolumn+1)-1);
     59                    end
     60                else
     61                    out=ss; %reproduce the input string
    5762                end
    58             else
    59                 out=ss; %reproduce the input string
    6063            end
    6164        end
     
    6467        check_numeric=zeros(size(ss));
    6568        for ilist=1:numel(ss)
    66             if ~isempty(str2num(ss{ilist}))
     69            if ~strcmp(ss{ilist},'image') && ~isempty(str2num(ss{ilist}))
    6770                out{ilist,1}=str2num(ss{ilist});
    6871                check_numeric(ilist)=1;
Note: See TracChangeset for help on using the changeset viewer.