This is a static copy of a profile report

Home

rot90 (1 call, 0.000 sec)
Generated 15-Mar-2007 12:01:59 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\elmat\rot90.m
[Copy to new window for comparing multiple runs]

Parents (calling functions)

Function NameFunction TypeCalls
ima...\private\readbmpdata>bmpReadData24M-subfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
24
[m,n] = size(A);
10.000 s96.0%
26
k = 1;
10.000 s4.0%
38
B = A(n:-1:1,:);
10 s0%
37
A = A.';
10 s0%
36
if k == 1
10 s0%
Other lines & overhead  0 s0%
Totals  0.000 s100% 
Children (called functions)
No children
M-Lint results
No M-Lint messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in file46
Non-code lines (comments, blank lines)20
Code lines (lines that can run)26
Code lines that did run7
Code lines that did not run19
Coverage (did run/can run)26.92 %
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 % From John de Pillis 19 June 1985
17 % Modified 12-19-91, LS.
18 % Copyright 1984-2004 The MathWorks, Inc.
19 % $Revision: 5.11.4.2 $ $Date: 2004/07/05 17:01:25 $
20
1 21 if ndims(A)~=2
22 error('MATLAB:rot90:SizeA', 'A must be a 2-D matrix.');
23 end
< 0.01 1 24 [m,n] = size(A);
1 25 if nargin == 1
< 0.01 1 26 k = 1;
27 else
28 if length(k)~=1
29 error('MATLAB:rot90:kNonScalar', 'k must be a scalar.');
30 end
31 k = rem(k,4);
32 if k < 0
33 k = k + 4;
34 end
35 end
1 36 if k == 1
1 37 A = A.';
1 38 B = A(n:-1:1,:);
39 elseif k == 2
40 B = A(m:-1:1,n:-1:1);
41 elseif k == 3
42 B = A(m:-1:1,:);
43 B = B.';
44 else
45 B = A;
46 end