function P = treefillprob(m,n,T,psi) global Ztree P = zeros(m^n,1); dims = repmat([m],[1 n]); [nodesi,nodesj]=find(T); ii = find(nodesi