get_multi_meas

PURPOSE ^

function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);

SYNOPSIS ^

function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);

DESCRIPTION ^

function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);

The function can be used in the occasions where plane current patterns
(adjacent or polar) are adopted for systems with more planes, i.e. set by
set_multi_currents function. Only non-current carrying electrodes are
involved in the measurements.



protocol= The selected protocol '{op}' or '{ad}'
elec    = The electrodes
no_pl   = The number of planes
I       = The RHS vectors, i.e., the current patterns padded with zeroes
          for the forward calculations
V       = The forward solution
voltage = The array of measureemnts according to the selected protocol
ind     = The index of the measurements

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);
0002 %function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);
0003 %
0004 %The function can be used in the occasions where plane current patterns
0005 %(adjacent or polar) are adopted for systems with more planes, i.e. set by
0006 %set_multi_currents function. Only non-current carrying electrodes are
0007 %involved in the measurements.
0008 %
0009 %
0010 %
0011 %protocol= The selected protocol '{op}' or '{ad}'
0012 %elec    = The electrodes
0013 %no_pl   = The number of planes
0014 %I       = The RHS vectors, i.e., the current patterns padded with zeroes
0015 %          for the forward calculations
0016 %V       = The forward solution
0017 %voltage = The array of measureemnts according to the selected protocol
0018 %ind     = The index of the measurements
0019 
0020 
0021 warning('EIDORS:deprecated','GET_MULTI_MEAS is deprecated as of 06-Jun-2012. ');
0022 
0023 if size(V,2)~= size(I,2)
0024    error('Unmatched pattens')
0025 end
0026 
0027 
0028 no_el = size(elec,1);
0029 el_pp = no_el/no_pl;
0030 
0031 I = I(size(vtx,1)+1:end,:);  %Lower chunk
0032 Vm = V(size(vtx,1)+1:end,:); %Lower chunk
0033 
0034 
0035 voltage = [];
0036 ind = [];
0037 df = [];
0038 
0039 d = size(I,2); %Injections
0040 
0041 for i=1:d %for each injection
0042 
0043    cn = 0;
0044 
0045    L = [];
0046    fst = 0;
0047    kk=0;
0048 
0049    for ej=1:el_pp:no_el
0050 
0051       kk=ej-1;
0052 
0053       for ei=1:el_pp-1
0054          if ei==1
0055             fst = ej;
0056          end
0057          L = [L;[kk+ei kk+(ei+1)]];
0058       end
0059       L = [L;[fst fst+16-1]];
0060    end
0061 
0062    LMP = []; %Exclude measurements engaging electrodes from different electrodes
0063 
0064    for j=1:size(L,1)
0065 
0066       if ceil(L(j,1)/el_pp) == ceil(L(j,2)/el_pp)
0067 
0068          LMP = [LMP;L(j,:)];
0069       end
0070    end
0071 
0072    el_in = find(I(:,i)~=0); % The current carring electrodes
0073 
0074    LM =[];
0075 
0076    for k=1:size(LMP,1)
0077       if ismember(LMP(k,:),el_in) == [0 0]
0078          LM = [LM;LMP(k,:)]; %Modified list current carring electrodes removed.
0079       end
0080    end
0081 
0082    lf = size(LM,1);
0083    dd = lf/no_pl;
0084 
0085    LN = [];
0086 
0087    k=0;
0088 
0089    for in=1:dd:lf %   1    13    25    37
0090 
0091       k = k+1;
0092 
0093       th_LM = LM(in:in+dd-1,:); %size(th_LM) = (12 2)
0094 
0095       if protocol == '{op}'
0096          for j=1:size(th_LM,1)
0097             if th_LM(j,1)== intersect(find(I(:,i)>0),in:k*el_pp)+1
0098                LN = [th_LM(j:end,:);th_LM(1:j-1,:)];
0099                break;
0100             end
0101          end
0102       elseif protocol =='{ad}'
0103          for j=1:size(th_LM,1)
0104             if th_LM(j,1)== intersect(find(I(:,i)<0),in:k*el_pp)+1
0105                LN = [th_LM(j:end,:);th_LM(1:j-1,:)];
0106                break;
0107             end
0108          end
0109       else
0110          error('Protocol needs to be {op} or {ad}');
0111       end
0112 
0113       for u=1:size(LN,1)
0114          voltage = [voltage; (Vm(LN(u,1),i)- Vm(LN(u,2),i))];
0115       end
0116 
0117 
0118       ind = [ind;LN];
0119       cn = cn+1;
0120 
0121    end %for in
0122 
0123    df = [df;cn];
0124 end %for injections
0125 
0126 
0127 
0128 
0129 
0130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0131 % This is part of the EIDORS suite.
0132 % Copyright (c) N. Polydorides 2003
0133 % Copying permitted under terms of GNU GPL
0134 % See enclosed file gpl.html for details.
0135 % EIDORS 3D version 2.0
0136 % MATLAB version 5.3 R11
0137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0138 
0139 
0140 
0141

Generated on Fri 30-Dec-2022 19:44:54 by m2html © 2005