help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ML compatibility question...


From: Ben Abbott
Subject: Re: ML compatibility question...
Date: Tue, 29 Nov 2011 22:13:44 -0500

On Nov 29, 2011, at 6:10 PM, fork wrote:

> Could anyone verify that magic(0)+magic(3) gives magic(3) in ML, rather than
> erroring out?  If so, maybe this could be added to Jordi's bsxfun project?
> 
> In Octave 3.4.3,  magic(0)+magic(3) gives a nonconformant error, and so does
> magic(0).+magic(3) but magic(1)+magic(3) works ok.  I am using SDPT in my 
> cooks
> tour of optimization programs, and I am seeing a problem with this.
> 
> Tx

"magic(0)" is empty, so "magic(0)+magic(3)" should give an error.

The ML result is ...

        magic(0) + magic(3)
        Error using  + 
        Matrix dimensions must agree.
 
        magic(0)

        ans =

             []

        magic(3)

        ans =

             8     1     6
             3     5     7
             4     9     2

Looking at magic(1)

        magic (1)

        ans =

             1

        magic(1) + magic(3)

        ans =

             9     2     7
             4     6     8
             5    10     3

Ben


reply via email to

[Prev in Thread] Current Thread [Next in Thread]