[Numpy-discussion] Matlab Translation - sqrt elementwise

Bill Baxter wbaxter@gmail....
Tue Apr 17 15:31:56 CDT 2007


Be sure to check out the numpy examples page too.
    http://www.scipy.org/Numpy_Example_List
Always a good resource if you're not sure how to call a particular command.

--bb

On 4/18/07, Miquel Poch <miquel.poch@gmail.com> wrote:
> Hi,
>
> I've found the next expression write it in Matlab,
>
> Rtx   = sqrt(Rt);
>
> Rtx is a matrix, and that's why I need sqrt() to operate elementwise. I've
> read NumPy tutorial, and I know it's possible,
>
> A set of this functions, has been provided wich optimize certain kinds of
> calculations on arrays. Most of this functions, such as sin, cos and sqrt
> are unary functions wich operate elementwise.  [Numerical Python, pg. 13]
>
> but I don't know who to do it. The next error appear when I execute the
> code,
>
> ''' exceptions.TypeError : only length-1 arrays can be converted to Python
> scalars ''
>
> Thanks in advance,
> Mike
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
>


More information about the Numpy-discussion mailing list