0001 function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
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,:);
0032 Vm = V(size(vtx,1)+1:end,:);
0033
0034
0035 voltage = [];
0036 ind = [];
0037 df = [];
0038
0039 d = size(I,2);
0040
0041 for i=1:d
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 = [];
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);
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,:)];
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
0090
0091 k = k+1;
0092
0093 th_LM = LM(in:in+dd-1,:);
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
0122
0123 df = [df;cn];
0124 end
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141