getappdata.m

来自「matlab6.5」· M 代码 · 共 32 行

M
32
字号
function value = getappdata(h, name)
%GETAPPDATA Get value of application-defined data.
%  VALUE = GETAPPDATA(H, NAME) gets the value of the
%  application-defined data with name specified by NAME in the
%  object with handle H.  If the application-defined data does
%  not exist, an empty matrix will be returned in VALUE.
%
%  VALUES = GETAPPDATA(H) returns all application-defined data
%  for the object with handle H.
%
%  See also SETAPPDATA, RMAPPDATA, ISAPPDATA.

%  Damian T. Packer, May 1998
%  Copyright 1984-2002 The MathWorks, Inc.
%  $Revision: 1.11 $  $Date: 2002/04/08 22:41:29 $


error(nargchk(1, 2, nargin));

if length(h) ~= 1
   error('H must be a single handle.');
end

value = get(h, 'ApplicationData');
if nargin == 2
  if(isfield(value, name))
    value = subsref(value,struct('type','.','subs',name)); 
  else
    value = [];
  end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?