[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45319] mxCreateNumericArray with zero size
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #45319] mxCreateNumericArray with zero size |
Date: |
Mon, 15 Jun 2015 16:21:25 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0 |
Update of bug #45319 (project octave):
Status: None => Fixed
Open/Closed: Open => Closed
_______________________________________________________
Follow-up Comment #1:
Technically, all Matlab mxArray objects have two dimensions. According to the
documentation for mxCreateNumericArray
(http://www.mathworks.com/help/matlab/apiref/mxcreatenumericarray.html) for
the *ndim* argument:
Number of dimensions. If you specify a value for ndim that is less than 2,
mxCreateNumericArray automatically sets the number of dimensions to 2.
So correct code for an empty matrix is to specify ndims = 2, with dims[0] = 0,
dims[1] = 0. This will work in Octave or Matlab.
I have changed Octave to be Matlab-compatible if the ndims < 2. See this
changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/2691947f5409). This
will be a part of the next bug fix release 4.0.1. Until then you can use the
workaround above, or get the code from the stable branch of Octave's Mercurial
repository and build Octave for yourself.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45319>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/