Matlab how to generate row column and the same random matrix and the number of matrix And the sum is a fixed number, and the fixed number is known

Matlab how to generate row column and the same random matrix and the number of matrix And the sum is a fixed number, and the fixed number is known


Isn't it magic?