subsasgn.m

来自「剑桥大学用于线性和双线性动力学系统辨识的工具箱」· M 代码 · 共 70 行

M
70
字号
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 + =
减小字号Ctrl + -
显示快捷键?