function T = prodtaylor(F,posfactor,D,cols)

T = zeros(size(F));
inds = D(posfactor+1,:);
T(:,nonzeros(inds)) = F(:,inds~=0);
T = T(:,cols);
