How to add elements in MWarray from C# ms visual 2010
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi to everyone! I want to declare a MWarray with 20 elements, like: MathWorks.MATLAB.NET.Arrays.MWArray value = {100, 200, 1000.....,1543}; but I get error messages in every combination of {},[],"" etc I tried... Does anyone knows how it can be done?
0 Kommentare
Antworten (1)
Nidhi Jain
am 15 Jul. 2014
Hi,
There are a few data type mapping rules for converting .NET data types to MATLAB types using MWArray class hierarchy. You can use MWNumericArray to create the type of array you showed above. It can be done in C# as follows:
MWNumericArray output = new MWNumericArray(new int[] { 3, 2, 2 });
To read more about MWarray and its types, you can refer to the document: http://www.mathworks.com/help/dotnetbuilder/MWArrayAPI/HTML/index.html
Also, there is another example that illustrates the usage of types of MWarray: http://www.mathworks.com/matlabcentral/answers/91689-is-there-an-example-of-using-the-mwarray-data-type-in-a-net-language-such-as-c-with-a-matlab-bui
0 Kommentare
Siehe auch
Kategorien
Mehr zu Deploy to .NET Applications Using MWArray API finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!