MCR .Net using Native Dll, data type unsupported by matlab
5 次查看(过去 30 天)
显示 更早的评论
Hi there.
i have a MATLAB function that returns a struct (Instace) and a string (Json)
function [Instance,Json] = Process(path)
% Some Work
end
i am compiling this function into .Net dll and taking the native.dll file.
then i run this function from c#, and i get this error
"Data type unsupported by MATLAB .NET Assembly for conversion to array"
which means that the MCR can't convert the struct (Insrance) into a .Net object.
if i remove the struct (Instace), it works fine.
Q:
is there a way to ignore this parameter?, without returning just the Json.
it need to return both of them.
i don't need it just the json.
Thanks!
1 个评论
Piyush Kumar
2024-5-22
I found in the documentation that MATLAB Compiler SDK supports converting MATLAB structures to managed .NET types using MWStructArray.
I think you are able to compile the MATLAB function into .NET DLL successfully, but getting an error while running it from C#. Can you share the code snippet of the MATLAB and C# so that I can try reproducing it?
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!