我正在创建一个 GUI,用户在其中输入一个值,当他按下按钮时,它会运行一个外部函数并显示错误消息。我无法在 GUI 编码中成功插入变量。我对在哪里插入变量感到困惑。我试过手柄,但不幸的是它不起作用。
% --- Executes just before Stallfunction is made visible.
function Stallfunction_OpeningFcn(hObject, ~, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Stallfunction (see VARARGIN)
% Choose default command line output for Stallfunction
handles.user_entry = user_entry;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Stallfunction wait for user response (see UIRESUME)
% uiwait(handles.figure1);
我在上面的代码中插入了变量“user_entry”,对吗?