function [Er] = ref_master(E,vtx,gnd_ind,sch); Applying reference to the system. Modifying the system matrix to preserve uniqueness. E = The rank deficient by 1 system matrix Er = The full rank matrix sch = The grounding scheme: 0 for grounding node gnd_ind 1 for grounding electrode gnd_ind gnd_ind = The ground index
0001 function [Er] = ref_master(E,vtx,gnd_ind,sch); 0002 %function [Er] = ref_master(E,vtx,gnd_ind,sch); 0003 % 0004 %Applying reference to the system. Modifying the system matrix to 0005 %preserve uniqueness. 0006 % 0007 % 0008 % 0009 %E = The rank deficient by 1 system matrix 0010 %Er = The full rank matrix 0011 %sch = The grounding scheme: 0012 % 0 for grounding node gnd_ind 0013 % 1 for grounding electrode gnd_ind 0014 %gnd_ind = The ground index 0015 0016 warning('EIDORS:deprecated','REF_MASTER is deprecated as of 07-Jun-2012. '); 0017 0018 [nv,jnk] = size(vtx); 0019 0020 if nargin < 4 0021 sch = 0; 0022 end 0023 0024 if sch == 0 %Ground a surface node 0025 0026 Er = E; 0027 0028 Er(gnd_ind,:)= 0; %zeros(1,mas_c); 0029 Er(:,gnd_ind)= 0; %zeros(mas_r,1); 0030 Er(gnd_ind,gnd_ind) = 1; 0031 0032 else %Ground one of the boundary electrodes 0033 0034 Er = E; 0035 0036 if gnd_ind > size(E,1) - nv 0037 error('Grounding electrode index out of range') 0038 end 0039 0040 0041 Er(nv+gnd_ind,:)= 0; %zeros(1,mas_c); 0042 Er(:,nv+gnd_ind)= 0; %zeros(mas_r,1); 0043 Er(nv+gnd_ind,nv+gnd_ind) = 1; 0044 0045 end 0046 0047 0048 0049 0050 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0051 % This is part of the EIDORS suite. 0052 % Copyright (c) N. Polydorides 2003 0053 % Copying permitted under terms of GNU GPL 0054 % See enclosed file gpl.html for details. 0055 % EIDORS 3D version 2.0 0056 % MATLAB version 5.3 R11 0057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%