| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| R2010b Documentation → Financial Toolbox |
| Contents | Index |
| Learn more about Financial Toolbox |
| On this page… |
|---|
You can use the UICalendar graphical user interface in standalone mode to look up any date. To use the standalone mode:
Type the following command to open the UICalendar GUI:
uicalendar
The UICalendar interface is displayed:

Click the date and year controls to locate any date.
You can use the UICalendar graphical user interface with an application to look up any date. To use the UICalendar graphical interface with an application, use the following command:
uicalendar('PARAM1', VALUE1, 'PARAM2', VALUE2', ...)For more information, see uicalendar.
The UICalendar example creates a function that displays a graphical user interface that lets you select a date from the UICalendar graphical user interface and fill in a text field with that date.
Create a figure.
function uicalendarGUIExample
f = figure('Name', 'uicalendarGUIExample');Add a text control field.
dateTextHandle = uicontrol(f, 'Style', 'Text', ... 'String', 'Date:', ... 'Horizontalalignment', 'left', ... 'Position', [100 200 50 20]);
Add a uicontrol editable text field to display the selected date.
dateEditBoxHandle = uicontrol(f, 'Style', 'Edit', ... 'Position', [140 200 100 20], ... 'BackgroundColor', 'w');
Create a push button that startups the UICalendar.
calendarButtonHandle = uicontrol(f, 'Style', 'PushButton', ... 'String', 'Select a single date', ... 'Position', [275 200 200 20], ... 'callback', @pushbutton_cb);
To startup UICalendar, create a nested function (callback function) for the push button.
function pushbutton_cb(hcbo, eventStruct)
% Create a UICALENDAR with the following properties:
% 1) Highlight weekend dates.
% 2) Only allow a single date to be selected at a time.
% 3) Send the selected date to the edit box uicontrol.
uicalendar('Weekend', [1 0 0 0 0 0 1], ...
'SelectionType', 1, ...
'DestinationUI', dateEditBoxHandle);
end
endRun the function uicalendarGUIExample to display the application interface:

Click Select a single date to display the UICalendar graphical user interface:

Select a date and click OK to display the date in the text field:

![]() | Trading Calendars Graphical User Interface | Technical Analysis | ![]() |
View demos and recorded presentations led by industry experts.
Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.
| © 1984-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |