[Numpy-discussion] help with translating some matlab

Sturla Molden sturla at molden.no
Fri Feb 18 18:45:05 EST 2011


I think x.conj().transpose() is too verbose, use x.H instead :-)

Sturla



Den 18.02.2011 19:11, skrev Neal Becker:
> My translation is:
>
>      x1 = rcv[n:n-N:-1]
>
>      z = np.dot (P, x1.conj().transpose())
>
>      g = z / (_lambda + np.dot (x1, z))
>
>      y = np.dot (h, x1.conj().transpose())
>
>      e = x[n-N/2] - y
>
>      h += np.dot (e, g.conj().transpose())
>
>      P = (P - np.dot (g, z.conj().transpose()))/_lambda
>
> But it doesn't work.
>
> You say z should be a column vector.  I got:
> In [138]: x1.shape
> Out[138]: (64,)
>
> In [139]: z.shape
> Out[139]: (64,)
>
> Clearly, I did something wrong here.
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list