📄 subsasgn.m
字号:
function model = subsasgn(model,s,val)%BILIN/SUBSASGN Subscript assigning method for BILIN object.%% CUED System Identification Toolbox.% Cambridge University Engineering Department.% Copyright (C) 1998-2002. All Rights Reserved.% Version 1.00, Date: 01/06/2002% Created by H. Chen and E.C. Kerrigan.[n,m]=size(model.B);p=size(model.C,1);switch s.type case '.' switch upper(s.subs) case 'A' if size(val,1) == n & size(val,2) == n model.A = val; else error('The dimension of A is incompatible with the BILIN object.') end case 'B' if size(val,1) == n & size(val,2) == m model.B = val; else error('The dimension of B is incompatible with the BILIN object.') end case 'C' if size(val,1) == p & size(val,2) == n model.C = val; else error('The dimension of C is incompatible with the BILIN object.') end case 'D' if size(val,1) == p & size(val,2) == m model.D = val; else error('The dimension of D is incompatible with the BILIN object.') end case 'N' if size(val,1) == n & size(val,2) == n*m model.N = val; else error('The dimension of N is incompatible with the BILIN object.') end case {'X0','X'} if size(val,1) == n & size(val,2) == 1 model.X0 = val; else error('The dimension of X0 is incompatible with the BILIN object.') end case {'TS','T'} if size(val,1) == 1 & size(val,2) == 1 if val > 0 model.Ts = val; else error('Only positive values of Ts are allowed.') end else error('The dimension of Ts is incompatible with the BILIN object.') end otherwise error('Invalid subscript referencing.') end otherwise error('Invalid subscript referencing.')end% *** last line of subsasgn.m ***
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -