Creating a matrix from a function

Consider a function $f(a, b)$, where $0 leq a, b leq k$, and $a$ and $b$ are integers, for some known $k$.

I am looking for a short and efficient code to put these values into a matrix, such that the code can handle large values of $k$. That is, I am looking for a code that creates the $k times k$ matrix:

begin{equation}
F = begin{pmatrix}
f(1, 1)~~~f(1, 2) ~~~~~ cdots ~~~~~~~ f(1, k) \
f(2, 1)~~~f(2, 2) ~~~~~ cdots ~~~~~~~ f(2, k) \
cdots \
f(k, 1)~~~f(k, 2) ~~~~~ cdots ~~~~~~~ f(k, k)
end{pmatrix}.
end{equation}

I could only define the matrix by hand for a few small values of $k$.