📄 set.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 + -