📄 add_handle2delete.m
字号:
function structure=add_handle2delete(handle,structure)% Add handle to a list of handles in that should be deleted on exit from a GUI% This list of handles is in the field 'handles2delete' in global variable % PARAMS4TASK or, if there is a second input argument, in structure structure.% In this latter case the output argument is required as well.% See also: "delete_handles2delete"%% Written by: E. R.: November 8, 2003% Last updated: January 8, 2006: Select "handle.figure1" if handle is a structure%% add_handle2delete(handle) or% structure=add_handle2delete(handle,structure)% INPUT% handle handle to add to vector "structure.handles2delete"% structure structure, most likely with field "handles2delete" % (if second argument is not given structure PARAMS4TASK will be used)% OUTPUT% structure Only used if structure is also an input argumentglobal PARAMS4TASKif isstruct(handle) try handle=handle.figure1; catch disp('handle is structure') return endendif isempty(handle) if nargin == 1 structure=[]; end returnend tryif nargin == 1 if isfield(PARAMS4TASK,'handles2delete') PARAMS4TASK.handles2delete=[PARAMS4TASK.handles2delete;handle]; else PARAMS4TASK.handles2delete=handle; end if nargout > 0 structure=[]; endelse if isfield(structure,'handles2delete') structure.handles2delete=[structure.handles2delete;handle]; else structure.handles2delete=handle; endend catch% Apparently, PARAMS4TASK or "structure" have not yet been defined% do nothing end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -