objectaddsignature.m

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

M
40
字号
function Data = ObjectAddSignature(Data,Signature)
%  Helps to keep track of what kind of processing was performed on the Data.
%
% Receives:
%   Data                -   struct          -   Structure initially created with Object create
%   Signature   -     string         -   (optional)  The name of the function wich processes the Data. Default: eval('caller','mfilename')
%                               cell array of strings   -   list of signatures
% Returns:
%   Data                -   struct          -   Structure initially created with Object create%
%
% See Also:
%   CreateObject
%
%
% Example:
%   
%   
%   
% Created:
%   
%   Lev Muchnik    01/06/2004, lev@topspin.co.il, +972-54-4326496
%
%
%

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

if ~exist('Signature','var')
    Signature = eval('caller','mfilename');
end
if ~isfield(Data,'Signature')
    Data.Signature = {};
end   
if ischar(Signature)
    Data.Signature{end+1} = Signature;
elseif iscell(Signature)
    Data.Signature = [Data.Signature Signature];
end
    

⌨️ 快捷键说明

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