MCR .Net using Native Dll, data type unsupported by matlab
Afficher commentaires plus anciens
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 commentaire
Piyush Kumar
le 22 Mai 2024
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?
Réponses (0)
Catégories
En savoir plus sur Deploy to .NET Applications Using MWArray API dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!