用于 gui 的 MATLAB 日期选择弹出日历 [英] MATLAB date selection popup calendar for gui
问题描述
有人知道在 MATLAB gui 中显示弹出日期选择日历的方法吗?我知道金融工具箱有一个 uicalendar
功能,但不幸的是我没有那个工具箱.
Does anyone know of a method to display a popup date selection calendar in a MATLAB gui? I know the financial toolbox has a uicalendar
function, but unfortunately I don't have that toolbox.
我有一种预感,我将不得不为此使用一些 Java 或其他语言,对此我一无所知.
I have a hunch I'm going to have to use some Java or some other language for this one, which I know nothing about.
我正在寻找类似的东西:
(来源:welie.com)
I'm looking for something similar to this:
(source: welie.com)
在用户选择日期后会返回一个日期字符串.
which would return a date string after the user selects the date.
推荐答案
很遗憾,我没有太多时间来获得更完整的答案,但我会尝试 uitable
创建一个表格并定义 CellSelectionCallback
以获取日期.
I don't have much time for a more complete answer, unfortunately, but I'd try uitable
to create a table and to define the CellSelectionCallback
to get the date.
这里有一些帮助您入门:
Here's a bit to get you started:
dates = calendar;
dates(~any(dates,2),:) = [];
fh = figure;
uh = uitable('parent',fh,'data',dates,'ColumnWidth',repmat({20},1,7),...
'ColumnName',{'S','M','T','W','T','F','S'});
这篇关于用于 gui 的 MATLAB 日期选择弹出日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!