Hi everyone,

I would like to do the following.

Given matrix m and matrix n, I would like to compute mn[i,,j]= m[i,,j]
+ n[i,,j] if either of these elements is 0. (In other words, whichever
number is nonzero.)
Else I want mn[i,,j]=(m[i,,j] + n[i,,j])/2
I need a fast method.

Thanks very much for any help.

Bill Simpson

______________________________________________
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