⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 set.m

📁 matlab实用教程
💻 M
字号:
function s = set(s,varargin)
% SET Set stock properties to the specified values
% and return the updated object
propertyArgIn = varargin;
while length(propertyArgIn) >= 2,
   prop = propertyArgIn{1};
   val = propertyArgIn{2};
   propertyArgIn = propertyArgIn(3:end);
   switch prop
   case 'NumberShares'
      s.numShares = val;
   case 'SharePrice'
      s.sharePrice = val;
   case 'Descriptor'
      s.asset = set(s.asset,'Descriptor',val);
   otherwise
      error('Invalid property')
   end
end
s.asset = set(s.asset,'CurrentValue',...
   s.numShares * s.sharePrice,'Date',date);

⌨️ 快捷键说明

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