I'm working on an assignment where i have to assign 1 up to 10 distribution centers  to all US states. I have made a model in excel to calculate all the costs, and clearly the goal of the assignment is to find the cheapest way. I have 50 rows (for each state) and 10 columns (for all possible DC locations). My model is based on this matrix, and if I change the matrix, the costs will instantly display. The only constraint is that each state is supplied by exactly 1 DC.
Its clear I cant make all possible combinations by hand, I have tried to translate my model into an optimization program (AIMMS), but it'l take allot of time witch I already put in the excel model. I was thinking if I had all possible matrices (generated in R, Matlab, or Python, dont care witch one) i can loop over my spreadsheet them and let a program read the cost, to determine the best choice. Its theoretically possible to supply all state by 1 DC, and at most 10, so every possible  1x50, 2x50, 3x50 ... 10x50 matrix is needed to determine the best one.
So again in short, is it possible to generate every nxm binary matrix with a sum total of 1 on each row in preferably R, or otherwise in Matlab or Python?
TLDR: No.

Let's look at the simpliest example: 2 DC. Your possible rows will be:

(1,0)
(0,1)

Now you want to construct all possible 2x50 matrices. Their number is 2^50 (2 possible rows in 50 rows). It is equal to:
1125899906842624
We suppose that each matrix stores 100 bytes. That all 2x50 matrices will store:
(2**50) * 100 / 1024 / 1024 / 1024 / 1024 = 102400 terabytes of data.
And to process all of them (in the most optimistic results for normal computers) will spend time equal to:
(2**50) / 10**9 / 60 / 60 = 312 hours.
And 10x50 will be even more...
How to generate all posible binary nxm matrices, where the sum of each row is 1