On 4/2/2012 2:44 PM, Kris Thielemans wrote:
> Hi
> I've just upgraded to octave 3.6.1 and find that dividing a number by an
> array no longer works:
>
> octave>  tmp2=1/ones([3 4 5]);
> error: invalid conversion of NDArray to Matrix
> octave>  tmp2=1/ones([3 4]);
> error: operator /: nonconformant arguments (op1 is 1x1, op2 is 3x4)

  octave:9> 1./ones([3 4])
ans =

    1   1   1   1
    1   1   1   1
    1   1   1   1


>
> this does work in matlab though, so my old programs now crash. I wonder if
> this is unintended behaviour though as this stuff does work with the other
> operators + - *, for instance
>
> octave>  tmp2=1*ones([3 4 5]);
>
> (it doesn't work with ^, but neither does it in matlab)
>
> Kris
>
> PS: I do find the new broadcasting rules a great addition to octave. Thanks!
>
>


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to