This is a static copy of a profile report

Home

imagesci/private/isxwd (4 calls, 0.000 sec)
Generated 05-Aug-2011 13:01:20 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/imagesci/private/isxwd.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
imagesci/private/imftypefunction4
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
32
end
40 s0%
31
end
40 s0%
30
end
40 s0%
29
tf = false;
40 s0%
28
else
40 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
imagesci/private/isxwd>byteswapsubfunction40 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0 s0% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function32
Non-code lines (comments, blank lines)12
Code lines (lines that can run)20
Code lines that did run14
Code lines that did not run6
Coverage (did run/can run)70.00 %
Function listing
   time   calls  line
1 function tf = isxwd(filename)
2 %ISXWD Returns true for an XWD file.
3 % TF = ISXWD(FILENAME)
4
5 % Copyright 1984-2003 The MathWorks, Inc.
6 % $Revision: 1.1.6.2 $ $Date: 2005/11/15 01:12:43 $
7
8 % XWD files can be big or little-endian. Try it big-endian
9 % first.
4 10 fid = fopen(filename, 'r', 'ieee-be'); % BMP files are little-endian
4 11 if (fid < 0)
12 tf = false;
4 13 else
4 14 sig = fread(fid, 3, 'uint32');
4 15 fclose(fid);
4 16 if (length(sig) < 3)
17 tf = false;
4 18 else
4 19 if (sig(2) == 7)
20 tf = ((sig(1) >= 100) & (ismember(sig(3), [0 1 2])));
21
4 22 elseif (sig(2) == byteswap(7))
23 % 112 is 7 byte-reversed; maybe it's a little-endian XWD file.
24 sig(1) = byteswap(sig(1));
25 sig(3) = byteswap(sig(3));
26 tf = ((sig(1) >= 100) & (ismember(sig(3), [0 1 2])));
27
4 28 else
4 29 tf = false;
4 30 end
4 31 end
4 32 end

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