[R] How to get a gradient of a matrix

2011-07-13 Thread Bai
uot;expr". Thank, Best, Bai __ 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.

Re: [R] vectors cross-product V1 x V2

2011-07-08 Thread Bai
Thank you all. I do have two huge matrix like M1[x,y,z,3] x M2[x,y,z,3]. I'll try it. Best, Bai On Fri, Jul 8, 2011 at 11:56 PM, Jeff Newmiller wrote: > RSiteSearch("cross product") > library(pracma) > ?cross > > Speed is usually desired in the context of man

[R] vectors cross-product V1 x V2

2011-07-08 Thread Bai
Hi, everyone, I need an efficient way to do vectors cross product in R. Set vectors, V1 = ai + bj + ck V2 = di + ej + fk then the cross product is V1 x V2= (bf - ce) i + (cd - af) j + (ae - bd) k As shown here ( http://en.wikipedia.org/wiki/Cross_product ). Thanks. Best, Bai