Normal matrix multiplication computes $C=A*B$, such that $C_{ij}=\sum_k{A_{ik}*B_{kj}}$
I want to compute D, such that $D_{ij}=\sum_k{e^{A_{ik}*B_{kj}}}$
Basically I want to exponentiate each multipication result before they are summed into a single cell. How do I code this in MATLAB? Do I have to use for loop?
Thanks everybody who tried to help!
A more thorough discussion took place here
One of the answers in the link was already mentioned by Luis, but has the drawback that it blows up memory use when A and B are large. Say A is MxK, and B is KxN, the intermediate matrix created by bsxfun is MxKxN in size. We can keep it to MxN using a for loop, which according to my timing result did not cause performance to change from the one-liner given by Luis. (Details in the link above)