This is a static copy of a profile reportHome
rot90 (2 calls, 0.000 sec)
Generated 05-Aug-2011 13:03:17 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/elmat/rot90.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
filter2 | function | 2 |
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
38 | B = A(end:-1:1,end:-1:1); | 2 | 0 s | 0% |  |
37 | elseif k == 2 | 2 | 0 s | 0% |  |
34 | if k == 1 | 2 | 0 s | 0% |  |
33 | end | 2 | 0 s | 0% |  |
30 | if k < 0 | 2 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0 s | 0% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 44 |
Non-code lines (comments, blank lines) | 19 |
Code lines (lines that can run) | 25 |
Code lines that did run | 10 |
Code lines that did not run | 15 |
Coverage (did run/can run) | 40.00 % |
Function listing
time calls line
1 function B = rot90(A,k)
2 %ROT90 Rotate matrix 90 degrees.
3 % ROT90(A) is the 90 degree counterclockwise rotation of matrix A.
4 % ROT90(A,K) is the K*90 degree rotation of A, K = +-1,+-2,...
5 %
6 % Example,
7 % A = [1 2 3 B = rot90(A) = [ 3 6
8 % 4 5 6 ] 2 5
9 % 1 4 ]
10 %
11 % Class support for input A:
12 % float: double, single
13 %
14 % See also FLIPUD, FLIPLR, FLIPDIM.
15
16 % Thanks to John de Pillis
17 % Copyright 1984-2010 The MathWorks, Inc.
18 % $Revision: 5.11.4.5 $ $Date: 2010/08/23 23:08:13 $
19
2 20 if ~ismatrix(A)
21 error(message('MATLAB:rot90:SizeA'));
22 end
2 23 if nargin == 1
24 k = 1;
2 25 else
2 26 if ~isscalar(k)
27 error(message('MATLAB:rot90:kNonScalar'));
28 end
2 29 k = rem(k,4);
2 30 if k < 0
31 k = k + 4;
32 end
2 33 end
2 34 if k == 1
35 B = A(:,end:-1:1);
36 B = B.';
2 37 elseif k == 2
2 38 B = A(end:-1:1,end:-1:1);
39 elseif k == 3
40 B = A.';
41 B = B(:,end:-1:1);
42 else
43 B = A;
44 end