How could I solve this error: Invalid quadratic form: product is complex

This is a beamforming problem. I am confused with this error for long. I will appreciate it if someone can help me.

image

The real{ y’*theta_0} has been used, but it seems usefuless.

Use quad_form(y,inv(C(:,:,i))) instead of.something else in your code.