Why am I unable to use the ITEM property of the MWCellArray in C# code by using dot operator while using a component built using MATLAB Builder NE 3.0 (R2008b)?

I referred to the following for MWCellArray properties of MATLAB Builder NE 3.0 (R2008b):
web([docroot '/toolbox/dotnetbuilder/MWArrayAPI/HTML/MathWorks.MATLAB.NET.Arrays.MWCellArrayProperties.html'])
In the C# project, I use MWCellArray object. All the properties in the documentation above are accessible through dot opertor as follows; however, only the item property cannot be used as other properties:
mwca.IsCellArray; //where mwca is the MWCellArray object.

 Accepted Answer

The ability to access the ITEM property of MWCellArray object using dot(.) operator is not available in C# code where in the component built from MATLAB Builder NE 3.0 (R2008b) is being used.
To work around this issue, use the indexing operator to access the cell element(s) as follows:
mwca[1];
mwca[2]; //instead of using mwca.item
Note: 'item' is a special property which can be used in Visual Basic as x.Item(i) or x(i) to index the item; but, C# tries to be more compact in its syntax and only supports x[i] kind of indexing.

More Answers (0)

Categories

Find more on MATLAB Compiler SDK in Help Center and File Exchange

Products

Release

R2008b

Community Treasure Hunt

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

Start Hunting!