小编K.R*_*mel的帖子

Matlab GUI:如何更新句柄结构?

我正在研究GUI.我想将数据存储在句柄结构中创建的额外字段中.但是,当回调函数结束时,我不知道如何正确更新句柄结构.请提出任何建议.

我的简化程序

  • 设定信号数(1-10).每个信号有3个参数.
  • 从句柄结构中创建的数组中读取所选信号的参数(默认为零).
  • 编辑参数,更新数组.

GUI

function simple_gui(hObject, h)

h.fig = figure(...
    'Units','pix',...
    'Position',[50 50 500 400],...
    'Visible','default',...
    'Name','GUI',...
    'NumberTitle','off',...
    'Resize','on');

table = {'1' , '2', '3' , '4', '5', '6', '7', '8', '9', '10' };

h.number = uicontrol(...
    'Units','characters',...
    'Max',10,...
    'Min',1,...
    'String',table,...
    'Style','popupmenu',...
    'Value',1,...
    'Position',[37.4 28.3846153846154 19.4 1.61538461538462],...
    'BackgroundColor',[1 1 1]);

h.edit1 = uicontrol(...
    'Units','pix',...
    'String','0',...
    'Style','edit',...
    'Position',[180 280 50 20],...
    'BackgroundColor',[1 1 1],...
    'FontSize',10);

h.edit2 = uicontrol(...
    'Units','pix',...
    'String','0',...
    'Style','edit',...
    'Position',[180 255 50 20],...
    'Children',[],...
    'FontSize',10);

h.edit3 = …
Run Code Online (Sandbox Code Playgroud)

matlab user-interface handles

6
推荐指数
1
解决办法
349
查看次数

标签 统计

handles ×1

matlab ×1

user-interface ×1