I don’t understand how quad_over_lin(X,y) works if X is a column vector with the complex numbers and y>0 is a scalar.

For Example:

if

X =

1.0000 + 2.0000i

3.0000 - 4.0000i

y =

4

then;

X.^2/y =

-0.7500 + 1.0000i

-1.7500 - 6.0000i

while

quad_over_lin(X,y,2)

1.2500

6.2500

Which is not the same. I know quad_over_lin( X, Y, NDIMS(X) + 1 ) = ABS( X ).^2 ./ Y. How can I obtain this X.^2/y.