how to pass to a .NET object a struct ?
1 view (last 30 days)
Show older comments
I know that a limitation is that u cannot pass to a .NET queue element a struct or array of structs.
My requirement is that I have queues whose elements are matlab structs elements How can I use the .NET Queue with MATLAB native structs? I mean is there a extra step trick I could do ?
Example: I have 5 MATLAB structs elements who I want to put in a .NET Queue and the use push , get from the .NET Queue who will get or put in queue structs elememts....
I tried with Numbers and it works,
t = NET.createGeneric('System.Collections.Generic.Queue',{'System.Double'},10);
t.Enqueue(1)
t.Enqueue(2)
t.Enqueue(3)
x=t.GetEnumerator();
while x.MoveNext();
disp(x.Current)
end
but when I try to use structs I get an error
t = NET.createGeneric('System.Collections.Generic.Queue',{'System.Object'},10);
c=struct('cockyStruct',1);
No method 'Enqueue' with matching signature found for class 'System.Collections.Generic.Queue<System*Object>'.
Is there a trick or extra step I could do ?
0 Comments
Answers (0)
See Also
Categories
Find more on .NET Methods in MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!