Clear Filters
Clear Filters

MCR .Net using Native Dll, data type unsupported by matlab

31 views (last 30 days)
Hi there.
i have a MATLAB function that returns a struct (Instace) and a string (Json)
function [Instance,Json] = Process(path)
% Some Work
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.
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.
  1 Comment
Piyush Kumar
Piyush Kumar on 22 May 2024 at 9:17
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?

Sign in to comment.

Answers (0)




Community Treasure Hunt

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

Start Hunting!