Rusyte, Lina wrote:
> 
> Dear Sirs,
> 
> I would like to ask you, what function can I use for matrices addition?
> I couldn't find any information about it in the manual or in the
> internet.
> (A+B suits, when the number of matrixes is small, function sum() doesn't
> suit for matrices addition, because it sums all variables in the
> matrices and produces as an answer single number, not a matrix).
> I would be very thankful for your help.
> 
> 

 If you can get your matrices into a list, use Reduce():

> A = matrix(runif(100),nrow=10)
> B = Reduce("+",list(A,A,A,A,A))
> max(abs(B-5*A))
-- 
View this message in context: 
http://www.nabble.com/Help-for-R-%28Advanced-matrix-addition-%28large-or-undefined-number-of-matrices%29-tp24934303p24934911.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to