How to access an object passed through .NET in MATLAB (MWObjectArray)

I want to interface MATLAB and .NET and want to use MATLAB to perform some mathematical calculations for my application. I want to use an object passed from C# to Matlab. The code below is my C# snippet -
if true
MWObjectArray test = new MWObjectArray();
testObj obj = new testObj();
testObj obj1 = new testObj();
obj.value1 = 1;
obj.value2 = 1.1;
obj.value3 = "some text";
obj.value1 = 2;
obj.value2 = 2.2;
obj.value3 = "some more text";
Dictionary<string, testObj> dict = new Dictionary<string, testObj>();
dict.Add("thePlan", obj);
dict.Add("Assets", obj1);
test.Object = (Object)dict;
MWArray ret = lib.mirror(test);
end
Now I want to access the object obj with the label "The plan". How do I write my mirror(x) function in MATLAB? Should I treat it as a structure and directly access it by saying something like x.value1? or do I have to something else?

Answers (0)

Asked:

SG
on 17 Sep 2018

Community Treasure Hunt

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

Start Hunting!