0001 function PSI = create_PSI(in)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 P = in.P;
0012
0013 if ~isfield(in,'Lp');
0014 Psi = in.Psi;
0015 L = size(Psi,2);
0016 eta = (size(Psi,1)-L)/(2);
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 Pr = P*L+2*eta;
0030 PSI = zeros(Pr,P*L);
0031 for p = 1:P
0032 PSI((p-1)*L+1:p*L+2*eta,(p-1)*L+1:p*L) = Psi;
0033
0034
0035
0036
0037 end
0038 else
0039 Lp = in.Lp;
0040 ETA = in.ETA;
0041 if length(Lp)+1 ~= length(ETA)
0042 error('number of LOT parameters is not correct');
0043 end
0044 Pr = sum(Lp)+ETA(1)+ETA(end);
0045 Pc = sum(Lp);
0046 PSI = zeros(Pr,Pc);
0047 pr = 1; pc = 1;
0048 for p = 1:length(Lp)
0049 L = Lp(p);
0050 if L < ETA(p)+ETA(p+1)
0051 error('LOT interval partition parameters are not workable');
0052 end
0053 in_Psi = []; in_Psi.L = L; in_Psi.eta = ETA(p); in_Psi.eta1 = ETA(p+1);
0054 Psi = create_LOT(in_Psi);
0055 PSI(pr:pr+L+ETA(p)+ETA(p+1)-1,pc:pc+L-1) = Psi;
0056 pc = pc+L;
0057 pr = pr+L+ETA(p)-ETA(p+1);
0058 end
0059 end