fioaddparameter.m

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

M
35
字号
function [InputCells] = FIOAddParameter(InputCells,ParameterName,ParameterValue)
% The function adds new parameter to the input cells
%
% Receives:
%   InputCells      -   cell array  -   Cell array in FlexIO format
%   ParameterName   -   string      -   A valid parameter name.
%   ParameterValue  -   any type    -   The parameter value.
%
% Returns:
%  InputCells      -   cell array  -   Cell array in FlexIO format with the new parameter added.
%   
% Created:
% Lev Muchnik    27/03/2002, 
% +972-54-4326496, LevMuchnik@gmail.com

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

if iscell(InputCells) & numel(InputCells) == 1 & iscell(InputCells{1})
    InputCells = InputCells{1};
end

[Success ErrorString] = FIOTestInput(InputCells);

if ~Success
    error(['The InputCells is not given in valid FlexIO format. ' ErrorString]);
end
    
if ~ischar(ParameterName) | ~isvarname(ParameterName)
    error('The ParameterName must be a valid parameter name');
end

InputCells{end+1} = ParameterName;
InputCells{end+1} = ParameterValue;

⌨️ 快捷键说明

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