Changeset 697 for trunk/src/xml2struct.m
- Timestamp:
- Nov 6, 2013, 10:52:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/xml2struct.m
r687 r697 60 60 end 61 61 case 'char' 62 out=ss; %reproduce the input string63 62 % try to convert to number if the char does not correspond to a function (otherwise str2num calls this function as it uses 'eval') 64 63 if ~isempty(regexp(ss,'^(-*\d+\.*\d*\ *)+$')) || ~isempty(regexp(ss,'\d+e(-|+)\d+')) % if the string corresponds to a set of numbers (with possible sign and decimal, or scientific notation) separated by blanks … … 68 67 if ~isempty(sep_ind) 69 68 sep_ind=[-2 sep_ind length(ss)+1]; 69 out={}; 70 70 for icolumn=1:length(sep_ind)-1 71 out{1,icolumn}=ss(sep_ind(icolumn)+3:sep_ind(icolumn+1)-1); 71 out{1,icolumn}=ss(sep_ind(icolumn)+3:sep_ind(icolumn+1)-1);% get info between separators as a cell array 72 72 end 73 73 else … … 76 76 end 77 77 case 'cell' 78 out= [];%default78 out={};%default 79 79 check_numeric=zeros(size(ss)); 80 80 for ilist=1:numel(ss)
Note: See TracChangeset
for help on using the changeset viewer.