objectgettype.m

来自「复杂网络的一些节点面对攻击的代码」· M 代码 · 共 34 行

M
34
字号
function Type = ObjectGetType(Data)
%  Returns the type of the object
%
% Receives:
%   Data                -   struct          -   Structure initially created with ObjectCreate function. Will return it's type.
%                         anythhing else - an empty string is returned.
%
% Returns:
%   Type            -   string          -   The name of the Data object type
%
% See Also:
%   CreateObject
%
%
% Example:
%   
%   
%   
% Created:
%   
%   Lev Muchnik    01/06/2004, lev@topspin.co.il, +972-54-4326496
%
%     Lev Muchnik   30/10/2004, lev@topspin.co.il, +972-54-4326496
%       Input 'Data'  is allowed to be array of structs.


error(nargchk(1,1,nargin));
error(nargoutchk(0,1,nargout));

if isstruct(Data) & isfield(Data,'Type') & ischar(Data(1).Type)
    Type = Data(1).Type;
else
    Type = '';
end

⌨️ 快捷键说明

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