I have a math model, the math is A*B=C
A is a 1*m matrix; B is m*n matrix and C is a 1*n matrix.
B has condition is the sum of each row must ==1.
I wrote a test code to test it:
A=[100 230 30]B=[1 0 0;1 0 0;0 0 1]C=A*BD=A\C
but unfortuatly, the result D is not equal to B. I have no idea how could I add the condition of B, and how to write the correct code. and also why D~=B ?
thank you
Best Answer