Re: X*Y=X and sum(X)=1
- From: Roy Stogner <roystgnrNO@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 23:12:24 GMT
On Mon, 28 Nov 2005 13:16:31 -0800, meris300 wrote:
> X(1xn)* Y(n*n)=X(1xn)
>
> I know Y and i know that the sum of all the elements of the unknow
> vector X must add 1
>
> PS: ideas on how to solve this in MATLAB are also very welcome :-)
This may not have a solution (imagine if Y was the zero matrix, for
example) and it may have up to n linearly independent solutions (imagine
if Y was the identity matrix). If it does have a solution, this solution
will satisfy A*x'=b, where A = [Y' - eye(n); ones(1,n)] and
b = [zeros(n,1); 1]. Matlab will give you a least-squares solution from
x = A\b, and if you know you have exactly one solution then this should be
it to within a multiple of floating point error.
Remember that matrix equations are just systems of linear equations. If
you've got another equation (like sum(X) = 1), try adding it as another
row to the matrix.
---
Roy Stogner
.
- Follow-Ups:
- Re: X*Y=X and sum(X)=1
- From: meris300
- Re: X*Y=X and sum(X)=1
- References:
- X*Y=X and sum(X)=1
- From: meris300
- X*Y=X and sum(X)=1
- Prev by Date: Re: Haybaler problem... !?
- Next by Date: Re: I need help on Delaunay triangulation
- Previous by thread: X*Y=X and sum(X)=1
- Next by thread: Re: X*Y=X and sum(X)=1
- Index(es):