Path: news.mathworks.com!not-for-mail
From: "Geoffroy " <grsabourin@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: mxCreateDoubleMatrix() function
Date: Thu, 1 Oct 2009 03:19:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 37
Message-ID: <ha1735$j6n$1@fred.mathworks.com>
References: <h9vvuk$qip$1@fred.mathworks.com> <ha07a3$bg6$1@fred.mathworks.com>
Reply-To: "Geoffroy " <grsabourin@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254367141 19671 172.30.248.38 (1 Oct 2009 03:19:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 1 Oct 2009 03:19:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1783707
Xref: news.mathworks.com comp.soft-sys.matlab:574105


Yes I have finally found this function but I don't have any result. If I call the function like that

const mwSize dims[]={3,3};
const mwSize NbDimension = 2;
MatlabArray = mxCreateNumericArray( NbDimension, dims, mxUINT16_CLASS, mxREAL );

I put the variable like that
engPutVariable( m_pEngine, in_VarName.c_str(), MatlabArray ) ;

I obtain a 3x3 matrix in the matlab workspace ( only one dimension)

If I try to increase the dimension the function return 0
	const mwSize dims[]={3,3};
	const mwSize NbDimension = 4;
	MatlabArray = mxCreateNumericArray( NbDimension, dims, mxUINT16_CLASS, mxREAL );



"Titus Edelhofer" <titus.edelhofer@mathworks.de> wrote in message <ha07a3$bg6$1@fred.mathworks.com>...
> 
> "Geoffroy " <grsabourin@gmail.com> schrieb im Newsbeitrag 
> news:h9vvuk$qip$1@fred.mathworks.com...
> >I have created a small interface to transfert data between a C++ program 
> >and a Matlab workspace. It is working well but I don't know how to create a 
> >3 dimensional matrix to contain a RGB image. I'am able to create and 
> >transfert 2D matrix but not a 3D matrix like Im = zeros ( 10, 10, 10 );
> >
> > How is it possible to do that?
> >
> > Thank you
> 
> Hi,
> you will need to use mxCreateNumericArray. The doc gives a three dimensional 
> example.
> 
> Titus 
>