I have two matrices A and B.

B is just a matrix with only one of the diagonal elements non zero. All the non diagonal elements are zero as well. I have to calculate $A^{-1}B$. My $A^{-1}B$ matrix is sparse. In matlab I can do A\B. But is there any trick to further speed this up?

I have a bunch of B matrices in which only one of the diagonal elements are non zero and the non diagonal elements are zero. I cannot store the $A^{-1}$. Is there any way to speed this up?