initializing mwArray as "empty"

Hi,
i have a problem when using a specific Matlab .dll in C++. I need to have an empty mwArray variable (empty as representing [] in MATLAB) to be able to call it. I just do not know how to create an empty mwArray.
Any idea would be greatly appreciated, tanks in advance. ...

4 Comments

Adam
Adam on 21 Oct 2016
Edited: Adam on 21 Oct 2016
Does the default constructor not do this? The help states:
mwArray()
Description
Construct empty array of type mxDOUBLE_CLASS.
Well, if so i did not recognize it ... i read somewhere that this would give an "uninitialized" mwArray... what would not necessarily mean "empty" in MATLAB i guess. The MATLAB dll however throws an exception when i try that, but that may be for another reason as well. I am not very deep inside the m-code that i would like to call. However, if the the help says it's empty i'll take that.
Thanks a lot, (i still wonder why i did not find it ... ) ...
@Adam: Please post answers in the answers section, such that the OP can mark the problem as solved.
I tend to only post as an answer if I am confident it is an actual answer. In this case I just took a quick look in the help and threw that out as a query without having tried it out for myself.

Sign in to comment.

 Accepted Answer

The default constructor
myArray( );
should do this.

More Answers (0)

Asked:

on 21 Oct 2016

Answered:

on 24 Oct 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!