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

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

[Octave-bug-tracker] [bug #49010] mxSetDimensions for cell arrays


From: Rik
Subject: [Octave-bug-tracker] [bug #49010] mxSetDimensions for cell arrays
Date: Thu, 8 Sep 2016 19:48:41 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #2, bug #49010 (project octave):

I duplicated the array so that I am not working on the constant inputs.  I
think this is the correct strategy, but it does still fail which means there
likely is a problem with mxSetDimensions in Octave.


#include "mex.h"

void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{

    mxArray *mx[1];
    mwSize *dim = NULL;
    
    /* Create copy of input, *never* modify an input */
    mx[0] = mxDuplicateArray (prhs[0]);

    mexCallMATLAB (0, NULL, 1, mx, "disp");
    
    /* assume first input argument has two elements */
    dim = mxMalloc (2 * sizeof (*dim));
    dim[0] = 1; dim[1] = 2;
    mxSetDimensions(mx[0], dim, 2);
    mxFree(dim);
    
    mexCallMATLAB (0, NULL, 1, mx, "disp");
}





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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