MATLAB: Code for elements in equation to create a matrix

matrix

D is a 1×3 matrix
f is a 3×3 matrix
I want to create a matrix of A by the following equation:
for j=1:3
for i=1:3
A(i)=(sum(D(j).*f(i,j)))^-1;
end
end
But it turns out that the answer is wrong
What should be the correct code of this equation?

Best Answer

Lo, no need to use loops:
A = 1./(f*D)
Make sure that D is a column vector.
Related Question