Nongluck Klibbua <[EMAIL PROTECTED]> writes:

> Hi R-users,
> I try to use "solve" to find the answer of this linear equation
> a=x*b where a is 2*1 matrix and b is 2*2 matrix.I would like to get x so 
> I call y<-solve(a,b) but this one happen "a is 2*1 matrix" so what I should 
> do .
> Thanks 
> Luck
>

First get your extents right. For the matrix product x*b to make
sense, you need x to be n*2 if b is 2*2, and the result is n*2, so how
can a be 2*1?? 

Next, notice that solve(A,b) solves A*x = b, where A is a square
matrix, so you need solve(b,a) or maybe solve(b, t(a)) or
t(solve(b,t(a)) depending on what your problem really was.
 
-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])                  FAX: (+45) 35327907

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to