set.m

来自「matlab实用教程」· M 代码 · 共 18 行

M
18
字号
function a = set(a,varargin)
% SET Set asset properties and return the updated object
propertyArgIn = varargin;
while length(propertyArgIn) >= 2,
   prop = propertyArgIn{1};
   val = propertyArgIn{2};
   propertyArgIn = propertyArgIn(3:end);
   switch prop
   case 'Descriptor'
      a.descriptor = val;
   case 'Date'
      a.date = val;
   case 'CurrentValue'
      a.currentValue = val;
   otherwise
      error('Asset properties: Descriptor, Date, CurrentValue')
   end
end

⌨️ 快捷键说明

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