This is a static copy of a profile report

Home

importdata>analyze (4 calls, 0.907 sec)
Generated 05-Aug-2011 13:01:24 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/iofun/importdata.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
importdata>parsesubfunction4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
513
Data = textscan(fileString,'%[...
40.885 s97.6%
522
[isvalid, numHeaderCols, numHe...
40.022 s2.4%
583
end
40 s0%
579
if numHeaderCols > 0
40 s0%
578
numColumns = length(delimiterI...
40 s0%
All other lines  0 s0%
Totals  0.907 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
importdata>isvaliddatasubfunction40.022 s2.4%
Self time (built-ins, overhead, etc.)  0.885 s97.6%
Totals  0.907 s100% 
Code Analyzer results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function84
Non-code lines (comments, blank lines)26
Code lines (lines that can run)58
Code lines that did run26
Code lines that did not run32
Coverage (did run/can run)44.83 %
Function listing
   time   calls  line
500 function [numColumns, numHeaderRows, numHeaderCols, numHeaderChars] = ...
501 analyze(fileString, delim, header, bufsize)
502 %ANALYZE count columns, header rows and header columns
503
4 504 numColumns = 0;
4 505 numHeaderRows = 0;
4 506 numHeaderCols = 0;
4 507 numHeaderChars = 0;
508
4 509 if ~isnan(header)
4 510 numHeaderRows = header;
4 511 end
512
0.89 4 513 Data = textscan(fileString,'%[^\n\r]',1,'headerlines',numHeaderRows,...
514 'delimiter',delim.requested,'bufsize', bufsize);
4 515 thisLine = Data{1};
516
4 517 if isempty(thisLine)
518 return;
519 end
4 520 thisLine = thisLine{:};
521
0.02 4 522 [isvalid, numHeaderCols, numHeaderChars] = isvaliddata(thisLine, delim);
523
4 524 if ~isvalid && isnan(header)
525 numHeaderRows = numHeaderRows + 1;
526 Data = textscan(fileString,'%[^\n\r]',1,'headerlines',numHeaderRows,...
527 'delimiter',delim.requested, 'bufsize', bufsize);
528
529 thisLine = Data{1};
530 if isempty(thisLine)
531 return;
532 end
533 thisLine = thisLine{1};
534
535 [isvalid, numHeaderCols, numHeaderChars] = isvaliddata(thisLine, delim);
536 while ~isvalid
537 % stop now if the user specified a number of header lines
538 if ~isnan(header) && numHeaderRows == header
539 break;
540 end
541 numHeaderRows = numHeaderRows + 1;
542 if numHeaderRows >= 1000
543 %Assume no data.
544 Data = textscan(fileString,'%[^\n\r]','headerlines',numHeaderRows,...
545 'delimiter',delim.requested, 'bufsize', bufsize);
546 thisLine = Data{1};
547 numHeaderRows = length(thisLine) + numHeaderRows;
548 break;
549 end
550 Data = textscan(fileString,'%[^\n\r]',1,'headerlines',numHeaderRows,...
551 'delimiter',delim.requested, 'bufsize', bufsize);
552
553 thisLine = Data{1};
554 if isempty(thisLine)
555 break;
556 end
557 thisLine = thisLine{1};
558 [isvalid, numHeaderCols, numHeaderChars] = isvaliddata(thisLine, delim);
559 end
560 end
561
562 % This check could happen earlier
4 563 if ~isnan(header) && numHeaderRows >= header
4 564 numHeaderRows = header;
4 565 end
566
4 567 if isvalid
568 % determine num columns
569 %remove trailing spaces. Spaces are different from other delimiters.
4 570 thisLine = regexprep(thisLine, ' +$', '');
4 571 delimiterIndexes = strfind(thisLine, delim.printed);
4 572 if all(delim.printed ==' ') && length(delimiterIndexes) > 1
4 573 delimiterIndexes = delimiterIndexes([true diff(delimiterIndexes) ~= 1]);
4 574 delimiterIndexes = delimiterIndexes(delimiterIndexes > 1);
4 575 end
576
577 % format string should have 1 more specifier than there are delimiters
4 578 numColumns = length(delimiterIndexes) + 1;
4 579 if numHeaderCols > 0
580 % add one to numColumns because the two set of columns share a delimiter
581 numColumns = numColumns - numHeaderCols;
582 end
4 583 end

Other subfunctions in this file are not included in this listing.