MATLAB: How to find values that make up a desired linear combination of vectors

linear combination of vectors

I have 2 vectors A = [2 -1 2 1 0] B = [-1 1 1 0 1]
how can i get the 2 numbers x and y such that x*Ai + y*Bi gives me any vector C such that Ci > 0

Best Answer

There are infinitely many choices for x and y. Your inequalities can be reduced to:
0 < x < y < 2*x
Any pair of x and y satisfying these will cause C = x*A+y*B > 0.