function TheMat = MIMO_ML_SelectEstimParam(TheMat, TheSel); selects the columns of the matrix TheMat corresponding to the estimated parameters Output parameter TheMat = matrix where the columns contain only the estimated model parameters size: rows x number of free parameters Input parameter TheMat = matrix where the columns contain all model parameters size: rows x number of all parameters TheSel = structure with fields 'A', 'B', 'Ig' TheSel = struct('A',[],'B',[], 'Ig', []) TheSel.A = 1 x (OrderA+1) TheSel.A(r) = 1 if coeff. a(r-1) is unknown Sel.A(r) = 0 if coeff. a(r-1) = 0 TheSel.B = ny x nu x (OrderB+1) TheSel.B(i,j,r) = 1 if coeff. b(i,j,r-1) is unknown TheSel.B(i,j,r) = 0 if coeff. b(i,j,r-1) = 0 TheSel.Ig = ny x (OrderIg+1) TheSel.Ig(i,r) = 1 if coeff. ig(i,r-1) is unknown TheSel.Ig(i,r) = 0 if coeff. ig(i,r-1) = 0 Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, November 2009 All rights reserved. Software can be used freely for non-commercial applications only.
0001 function TheMat = MIMO_ML_SelectEstimParam(TheMat, TheSel); 0002 % 0003 % function TheMat = MIMO_ML_SelectEstimParam(TheMat, TheSel); 0004 % 0005 % selects the columns of the matrix TheMat corresponding to the estimated parameters 0006 % 0007 % 0008 % Output parameter 0009 % 0010 % TheMat = matrix where the columns contain only the estimated model parameters 0011 % size: rows x number of free parameters 0012 % 0013 % 0014 % Input parameter 0015 % 0016 % TheMat = matrix where the columns contain all model parameters 0017 % size: rows x number of all parameters 0018 % TheSel = structure with fields 'A', 'B', 'Ig' 0019 % TheSel = struct('A',[],'B',[], 'Ig', []) 0020 % TheSel.A = 1 x (OrderA+1) 0021 % TheSel.A(r) = 1 if coeff. a(r-1) is unknown 0022 % Sel.A(r) = 0 if coeff. a(r-1) = 0 0023 % TheSel.B = ny x nu x (OrderB+1) 0024 % TheSel.B(i,j,r) = 1 if coeff. b(i,j,r-1) is unknown 0025 % TheSel.B(i,j,r) = 0 if coeff. b(i,j,r-1) = 0 0026 % TheSel.Ig = ny x (OrderIg+1) 0027 % TheSel.Ig(i,r) = 1 if coeff. ig(i,r-1) is unknown 0028 % TheSel.Ig(i,r) = 0 if coeff. ig(i,r-1) = 0 0029 % 0030 % 0031 % Copyright (c) Rik Pintelon, Vrije Universiteit Brussel - dept. ELEC, November 2009 0032 % All rights reserved. 0033 % Software can be used freely for non-commercial applications only. 0034 % 0035 0036 0037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0038 % create row vector that selects the columns of the % 0039 % matrix corresponding to the estimated parameters % 0040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0041 0042 % A polynomial 0043 Select = TheSel.A; 0044 0045 % B ny x nu matrix polynomial 0046 % for jj = 1:nu 0047 % for ii = 1:ny 0048 % Select = [Select, squeeze(TheSel.B(ii,jj,:)).']; 0049 % end % ii 0050 % end % jj 0051 SelB = permute(TheSel.B,[3,1,2]); 0052 Select = [Select, SelB(:).']; 0053 0054 % Ig ny x 1 vector polynomial 0055 % for ii = 1:ny 0056 % Select = [Select, TheSel.Ig(ii,:)]; 0057 % end % ii 0058 SelIg = TheSel.Ig.'; 0059 Select = [Select, SelIg(:).']; 0060 0061 0062 %%%%%%%%%%%%%%%%%%%%%%%%%%% 0063 % selection columns Jacob % 0064 %%%%%%%%%%%%%%%%%%%%%%%%%%% 0065 0066 TheMat = TheMat(:, Select == 1);