title: Equivalent function of rdivide (matlab) in R language
body: <p>What would be an equivalent function of rdivide in R ? In my situation, I have matrices coming out of a numerical algorithm A,B and C. I need to get x such that x=C ./(AA'). In matlab, I am able to do it using rdivide. But I need to do this in R. So to give a reproducible example here is some matlab code.Note that det(AA')=0. Where A' is transpose of A.</p>
  
  <pre><code> % matlab code  
    t=6
   A = raylrnd(0.05,t,1)+0.09;
   B = gallery('randcorr',t);
   C = spdiags(A,0,t,t) * B * spdiags(A,0,t,t);
  x=C ./(A*A')
  
  #Rcode
   install.packages("Runuran","fifer")
   library("Runuran")
   library("fifer")
   t=6
   A = as.matrix(urrayleigh(t,0.05)+0.09)
   B &lt;- random.correlation (t, ev = runif(t, 0, 1)) 
   C= Diagonal(t,A) %*% B %*% Diagonal(t,A)
  </code></pre>