gradient(x'*A*x,x) gives the requested result ans =
A1_1*x1 + A1_2*x2 + A1_1*conj(x1) + A2_1*conj(x2)
A2_1*x1 + A2_2*x2 + A1_2*conj(x1) + A2_2*conj(x2)
Does anyone know a way to get the result in matrix form again: (A+A')x
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!