octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #45319] mxCreateNumericArray with zero size


From: Amro
Subject: [Octave-bug-tracker] [bug #45319] mxCreateNumericArray with zero size
Date: Thu, 16 Jul 2015 18:34:04 +0000
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0

Follow-up Comment #5, bug #45319 (project octave):

Here is a test:


#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
    const mwSize dims[] = {4,3,2};
    plhs[0] = mxCreateNumericArray(0, dims, mxDOUBLE_CLASS, mxREAL);
    if (nlhs > 1)
        plhs[1] = mxCreateNumericArray(1, dims, mxSINGLE_CLASS, mxREAL);
    if (nlhs > 2)
        plhs[2] = mxCreateNumericArray(2, dims, mxUINT8_CLASS, mxREAL);
    if (nlhs > 3)
        plhs[3] = mxCreateNumericArray(3, dims, mxINT32_CLASS, mxREAL);
}


In MATLAB, I get the following:


>> [x0,x1,x2,x3] = test_mex(); whos x*
  Name      Size             Bytes  Class     Attributes

  x0        0x0                  0  double              
  x1        4x1                 16  single              
  x2        4x3                 12  uint8               
  x3        4x3x2               96  int32               



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45319>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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