[Numpy-discussion] help with translating some matlab

Sturla Molden sturla@molden...
Fri Feb 18 17:45:05 CST 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@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion



More information about the NumPy-Discussion mailing list