This is a static copy of a profile report

Home

readScript (1 call, 0.044 sec)
Generated 05-Aug-2011 13:01:14 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/support/readScript.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
reduceDatafunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
32
[par,q]=interpret(par,lin);
210.044 s100.0%
48
return
10 s0%
47
fclose(fid);  
10 s0%
46
disp(' ')
10 s0%
45
disp('Script read successfully...
10 s0%
All other lines  0 s0%
Totals  0.044 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
readScript>interpretsubfunction210.044 s100.0%
readScript>parlistsubfunction10 s0%
readScript>checkstrsubfunction880 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0.044 s100% 
Code Analyzer results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function70
Non-code lines (comments, blank lines)24
Code lines (lines that can run)46
Code lines that did run23
Code lines that did not run23
Coverage (did run/can run)50.00 %
Function listing
   time   calls  line
1 function par=readScript(fn)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function par=readScript(fn)
6 %
7 % reads the data reduction script.
8 %
9 % sjcm
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1 11 par=[];
12
1 13 if (strcmp(fn(end-2:end),'.red'))
14 disp('Improper file type. Must have ext .red')
15 return
16 end
17
1 18 fid=fopen(fn,'r');
1 19 if (fid==-1)
20 error('Script not found!')
21 end
22
23 % read all lines
1 24 while(1)
89 25 lin=fgets(fid);
89 26 if (lin==-1)
27 % end of file reached
1 28 break;
88 29 else
88 30 str=sscanf(lin,'%s');
88 31 if (~checkstr(str))
0.04 21 32 [par,q]=interpret(par,lin);
21 33 if(~q)
34 fclose(fid);
35 return
36 end
21 37 end
88 38 end
88 39 end
40
41 % check that all parameters are accounted for
1 42 names=fieldnames(par);
1 43 caltype=parlist('caltype');
1 44 if (length(names)==length(caltype))
1 45 disp('Script read successfully!');
1 46 disp(' ')
1 47 fclose(fid);
1 48 return
49 else
50 disp('Parameter settings for some calibration step is missing')
51 disp('Setting to default values in readScript.m');
52 par=setdefault(par);
53 disp(' ')
54 end
55
56
57 %global_plotflag=plotflag.flag
58 %global_plotflag=2
59 fclose(fid);
60
61 % check that if in interactive mode, we actually plot shit.
62 if(par.interactive.flag==1)
63 if(par.plotflag.flag==0)
64 display('Warning: to use interactive mode you must plot data');
65 display('Setting your plotflag parameter to true');
66 par.plotflag.flag = 1;
67 end
68 end
69
70 return;

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