> -----Original Message----- > From: marco atzeri > Sent: 02 April 2012 14:17 > To: octave-dev@lists.sourceforge.net > Subject: Re: [OctDev] number/array fails: matlab incompatibility (and bug?) > > 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 > >
Thanks Marco. I did know about this (although failed to mention that, apologies), but was trying to flag up that the new rules cause a matlab incompatibility which didn't exist in previous versions of octave. Also, the behaviour is internally inconsistent as I noted below. > > > > 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 ------------------------------------------------------------------------------ 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