This is a static copy of a profile reportHome
menu (5 calls, 0.859 sec)
Generated 15-Mar-2007 12:01:42 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\uitools\menu.m
[Copy to new window for comparing multiple runs]
Parents (calling functions)
Function Name | Function Type | Calls |
legacy | M-function | 5 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
63 | k = local_GUImenu( xHeader, Ar... | 5 | 0.844 s | 98.2% |  |
46 | ArgsIn = varargin; % use th... | 5 | 0.000 s | 0.0% |  |
52 | useGUI = 1; % Assume we can ... | 5 | 0.000 s | 0.0% |  |
45 | else, | 5 | 0.000 s | 0.0% |  |
61 | if useGUI, | 5 | 0 s | 0% |  |
Other lines & overhead | | | 0.016 s | 1.8% |  |
Totals | | | 0.859 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
menu>local_GUImenu | M-subfunction | 5 | 0.844 s | 98.2% |  |
isunix | M-function | 5 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.016 s | 1.8% |  |
Totals | | | 0.859 s | 100% | |
M-Lint results
Line number | Message |
1 | Extra semicolon is unnecessary. |
43 | Use && instead of & as the AND operator in (scalar) conditional statements. |
45 | Extra comma is unnecessary. |
64 | Extra comma is unnecessary. |
Coverage results
[ Show coverage for parent directory ]
Total lines in file | 75 |
Non-code lines (comments, blank lines) | 57 |
Code lines (lines that can run) | 18 |
Code lines that did run | 9 |
Code lines that did not run | 9 |
Coverage (did run/can run) | 50.00 % |
Function listing
time calls line
1 function k = menu(xHeader,varargin);
2 %MENU Generate a menu of choices for user input.
3 % CHOICE = MENU(HEADER, ITEM1, ITEM2, ... ) displays the HEADER
4 % string followed in sequence by the menu-item strings: ITEM1, ITEM2,
5 % ... ITEMn. Returns the number of the selected menu-item as CHOICE,
6 % a scalar value. There is no limit to the number of menu items.
7 %
8 % CHOICE = MENU(HEADER, ITEMLIST) where ITEMLIST is a string cell
9 % array is also a valid syntax.
10 %
11 % On most graphics terminals MENU will display the menu-items as push
12 % buttons in a figure window, otherwise they will be given as a numbered
13 % list in the command window (see example, below).
14 %
15 % Command window example:
16 % >> K = menu('Choose a color','Red','Blue','Green')
17 % displays on the screen:
18 %
19 % ----- Choose a color -----
20 %
21 % 1) Red
22 % 2) Blue
23 % 3) Green
24 %
25 % Select a menu number:
26 %
27 % The number entered by the user in response to the prompt is
28 % returned as K (i.e. K = 2 implies that the user selected Blue).
29 %
30 % See also UICONTROL, UIMENU, GUIDE.
31
32 % J.N. Little 4-21-87, revised 4-13-92 by LS, 2-18-97 by KGK.
33 % Copyright 1984-2005 The MathWorks, Inc.
34 % $Revision: 5.21.4.2 $ $Date: 2005/06/21 19:41:25 $
35
36 %=========================================================================
37 % Check input
38 %-------------------------------------------------------------------------
5 39 if nargin < 2,
40 disp('MENU: No menu items to choose from.')
41 k=0;
42 return;
5 43 elseif nargin==2 & iscell(varargin{1}),
44 ArgsIn = varargin{1}; % a cell array was passed in
< 0.01 5 45 else,
< 0.01 5 46 ArgsIn = varargin; % use the varargin cell array
5 47 end
48
49 %-------------------------------------------------------------------------
50 % Check computer type to see if we can use a GUI
51 %-------------------------------------------------------------------------
< 0.01 5 52 useGUI = 1; % Assume we can use a GUI
53
5 54 if isunix, % Unix?
55 useGUI = length(getenv('DISPLAY')) > 0;
56 end % if
57
58 %-------------------------------------------------------------------------
59 % Create the appropriate menu
60 %-------------------------------------------------------------------------
5 61 if useGUI,
62 % Create a GUI menu to aquire answer "k"
0.84 5 63 k = local_GUImenu( xHeader, ArgsIn );
64 else,
65 % Create an ascii menu to aquire answer "k"
66 k = local_ASCIImenu( xHeader, ArgsIn );
67 end % if
68
69 %%#########################################################################
70 % END : main function "menu"
71 %%#########################################################################
72
73 %%#########################################################################
74 % BEGIN : local function local_ASCIImenu
75 %%#########################################################################
Other subfunctions in this file are not included in this listing.