Number of binary matrices whose rows/columns are weakly monotone Came across this question. Matrix $A$ is an $m$ by $n$ matrix whose elements are all 0 or 1. Each row/column of $A$ is weakly monotone. 
How many of such matrices are there?
 A: Let's assume that each row/column is weakly monotone increasing, i.e. each row/column has some number of 0's followed by some number of 1's.
Consider your matrix as an $m\times n$ grid in $\mathbb{Z}^2$ with bottom left corner at $(0,0)$ and upper right corner at $(m,n)$. If we look at the boundary between the 0 cells and the 1 cells, we get a lattice path from $(0,0)$ to $(m,n)$. Thus, the number of weakly monotone increasing matrices will be precisely the number of such lattice paths, i.e. ${m+n\choose n}$.
This same argument works to count such matrices in which each row/column is weakly monotone decreasing. However, if you wish to allow some rows/columns to be increasing while others can be decreasing, the situation is more complicated, but hopefully this can give you a starting point.
A: After computing $n\times n$ monotone binary matrices for a few $n$ and plugging the sequence into OEIS, I came across A032260 which is linked to a challenge problem hosted at IBM. (Also, they consider two obvious extensions of this combinatorial gadget: ternary monotone matrices, or monotone binary 3-dimensional hypermatrices.)
I will briefly reprise their argument here, with my own spin, in case the linked page goes down.
Claim: The number of $m$ by $n$ monotone binary matrices is $4n\binom{m+n-1}{n}-2mn=4m\binom{m+n-1}{m}-2mn$.
Proof: First, let us define the operation of column cycling a monotone matrix. That is, for a binary matrix, we let $\gamma$ be the map such that
$\gamma([a_{i,j}])=[b_{i,j}]$ where $b_{i,j}=a_{i,j-1}$ if $j>1$, and $b_{i,1}=a_{i,n}+1\ {\rm mod}\ 2$ otherwise. So for example,
$$\gamma\left(\begin{bmatrix}1&0&0 \\ 0&1&0\\ 0&0&1\end{bmatrix}\right)
=\begin{bmatrix}1&1&0\\1 &0&1\\0&0&0\end{bmatrix},\qquad \gamma^2\left(\begin{bmatrix}1&0&0 \\ 0&1&0\\ 0&0&1\end{bmatrix}\right)
=\begin{bmatrix}1&1&1\\0 &1&0\\1&0&0\end{bmatrix}$$
It is fairly straightforward to see that $\gamma$ preserves monotone matrices. Indeed, the columns are clearly still monotone as they are either unchanged, or have their entries flipped in value which will at most change it from being non-increasing to non-decreasing or vice versa. For the rows it is a little less obvious, but column cycling is simply taking the last entry of a row, flipping its value, and appending it to the front.
A nice way to see that this preserves monotonicity of rows is as follows: 
let $r=(r_1,\ldots, r_{3n-1})$
be the vector with $r_i=0$ if $i\leq n$ or $i\geq 2n+1$ and $r_i=1$ if $n+1\leq i\leq 2n$. Then the monotone rows are precisely the vectors $m_k=(r_{k+1},r_{k+2},\ldots, r_{k+n})$ for $0\leq k\leq 2n-1$, and column cycling is precisely the map $ m_k\mapsto m_{k-1\text{ mod }2n}$; e.g. for $n=3$,
$$r=(0,0,0,1,1,1,0,0)$$
$$m_5=(1,0,0)=\gamma(m_0)\qquad m_4=(1,1,0)=\gamma(m_5)\qquad m_3=(1,1,1)=\gamma(m_4)$$
$$m_2=(0,1,1)=\gamma(m_3)\qquad m_1=(0,0,1)=\gamma(m_2)\qquad m_0=(0,0,0)=\gamma(m_1)$$
In particular, note that for any matrix $A$, $\gamma^{k}(A)=A$ if and only if $2n|k$ (since this is in particular true for rows, and the overall action of $\gamma$ on a matrix is simply to apply $\gamma$ to each row), and moreover any matrix $A$ can be column cycled to a matrix whose first row only consists of $0$'s. Therefore it suffices to count the matrices whose first row is all $0$'s, as the total number of monotone matrices will then be $2n$ times this count.
Now suppose $A$ is a monotone matrix whose first row is the zero row. For the sake of argument, we will append an $(m+1)$th row of all $1$'s to the bottom of the matrix, and reindex the rows so they go from $0$ (the row of all 0's) to $m$ (the row of all $1's$. Then the columns must be non-decreasing, and for each column $j$ there is some row index $1\leq i(j)\leq m$ where $a_{i(j),j}=1$ and $a_{i(j)-1,j}=0$. 
Now since the rows must be monotone, it must be that
the sequence $(i(1),\ldots, i(n)$ is monotone as well. (Otherwise, if e.g. i(1) < i(2) > i(3), then the $i(2)$ row starts with $0,1,0$ which is clearly not monotone.) Conversely, if the sequence is monotone, then clearly so are the rows.
For example, if $m=n=2$, the pairing between monotone sequences and matrices (with  the row adjustments as above) goes like so:
$$(2,2)\leftrightarrow\begin{bmatrix}0&0\\0&0\\1&1\end{bmatrix}
\qquad (1,2)\leftrightarrow\begin{bmatrix}0&0\\1&0\\1&1\end{bmatrix}$$
$$(1,1)\leftrightarrow\begin{bmatrix}0&0\\1&1\\1&1\end{bmatrix}
\qquad (2,1)\leftrightarrow\begin{bmatrix}0&0\\0&1\\1&1\end{bmatrix}$$
Note that the number of monotonic matrices with non-decreasing rows is the same as the number of non-increasing sequences of $n$ integers in $\{1,\ldots, m\}$,
and likewise for non-increasing rows and non-decreasing sequences.
The number of such non-increasing or non-decreasing sequences is $\binom{m+n-1}{n}$. To see this, note that $\binom{m+n-1}{n}$ counts the number of ways to distribute $n$ indistinguishable balls into $m$ distinguishable bins, allowing some bins to be empty. We will demonstrate a bijection between such arrangements and non-decreasing sequences of $n$ numbers from $\{1,2,\ldots, m\}$.
Fix some distribution of balls into bins and let $b(i)$ be the number of balls in the $i$th bin. Define a sequence $\mathbf i=(i(j))$ by setting the first $b(1)$ entries to $1$, the next $b(2)$ entries to $2$, and so on with the next $b(i)$ entries set to $i$. Then $\mathbf i$ is nondecreasing by construction and each $1\leq i(j)\leq m$, so each arrangement defines one of our nondecreasing sequences of rows. Conversely, any
non-decreasing sequence of rows defines a distribution of $n$ indistinguishable balls into $m$ bins by putting $\#\{j:i(j)=k\}$ of the balls into the $k$th bin.
Again, to illustrate with a simple example $m=3,n=2$, counting the non-decreasing sequences, the pairing to the arrangements of $2$ objects into $3$ bins
$$(1,1)\leftrightarrow **||\qquad 
(1,2)\leftrightarrow *|*| \qquad
(1,3)\leftrightarrow *||*$$
$$(2,2)\leftrightarrow |**|\qquad 
(2,3)\leftrightarrow |*|* \qquad
(3,3)\leftrightarrow ||**$$
Therefore, the number of such arrangements and such non-decreasing sequences is the same, and similar logic works for non-increasing sequences.
Note that the number of monotone sequences is the sum of the number of non-increasing sequences and the number non-decreasing sequences, less the number of non-increasing and non-decreasing sequences. The only sequences which are non-increasing and non-decreasing are the constant sequences, of which there are $m$ (since the sequences take values in $\{1,2,\ldots m\}$. Thus the total number
of monotone binary matrices with the first row equal to the zero vector is
$2\binom{m+n-1}{n}-m$, and hence the total number of arbitrary monotone binary matrices is $2n(2\binom{m+n-1}{n}-m)=4n\binom{m+n-1}{n}-2mn$ as claimed.
