
% New way

PET0=PET_in(:,lndidx)';
PET=zeros(length(lndidx)*lyrs,12);
n=1;
for i=1:length(lndidx)
    pet_o=repmat(PET0(i,:),lyrs,1);
    j=1;k=12;
    for l=1:lyrs
        PET(n,:)=pet_o(l,j:k);
        j=j+12;k=k+12;n=n+1;
    end
end



