subsasgn.m
来自「matlab实用教程」· M 代码 · 共 26 行
M
26 行
function a = subsasgn(a,index,val)
% SUBSASGN Define index assignment for asset objects
switch index.type
case '()'
switch index.subs{:}
case 1
a.descriptor = val;
case 2
a.date = val;
case 3
a.currentValue = val;
otherwise
error('Index out of ');
end
case '.'
switch index.subs
case 'descriptor'
a.descriptor = val;
case 'date'
a.date = val;
case 'currentValue'
a.currentValue = val;
otherwise
error('Invalid field name')
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?