Infinite products of matrices arise in many areas, such as the study of subdivision and interpolation schemes, Markov chains, and construction of wavelets of compact support. These products are used here to give sufficient conditions for the continuity and differentiability of a class of rectangular compactly supported nonseparable N-dimensional prewavelets or scaling functions. This paper considers the dilation equation $\phi(X)=\sum_K C_K \phi(2X-K)$, where $K\in \{0, \ldots, m\}^N$, $\phi : {\cal R}^N \to {\cal R}$, and $C_K \in {\cal R}$. First, the one-dimensional case is studied, and sufficient conditions on CK, which guarantee a continuous scaling function $\phi(X)$, are given. These conditions are based on simultaneous triangularizability of two special matrices with entries in terms of CK. Then, these results are generalized to N dimensions and applied to the particular case where CK's are obtained by binomial interpolation of their values at the corners of the N-cube, $\{0,m\}^N$. A set of inequalities, based on sums of CK's on the corners of various faces of the N-cube gives sufficient conditions for the existence of smooth solutions to the dilation equation.