An example to clarify what I mean:
Generate some 2×3 matrices such that:
1) sum of row elements: row_sum=[100; 200; 300]
2) sum of column elements: column_sum=[500 100]
3) All elements greater than or equal to zero.
Possible_matrix_1=[100 0;200 0;200 100]
Possible_matrix_2=[50 50; 200 0;250 50]
and so on…
I understand that one way to is to generate random matrices and eliminate the ones that don't satisfy the conditions. However, I'd prefer something more efficient if it is possible.
Thank you
Kind regards,
Sharadhi
Best Answer