简体   繁体   中英

MATLAB NET.ASSEMBLY with C#

Im developing an application in Matlab and it calls a C# dll using NET.addAssembly to analyse files. I've created an structure in Matlab with some features about the kind of file to be analyse:

File = struct('Name','File Name','HeaderLines',14,'ColName','ID','ColIdx',[]...);

And I want to send this structure to my C# dll, that would read the file and fill some of the features of the structure and send it back to Matlab.

Is it possible to do that? Because at the moment Im getting errors: " No method 'xxx' with matching signature found.

Can you please confirm if Matlab structures are compatible in NET? Which is the more suitable object for this purpouse? Where can I find examples Matlab - NET Assembly?

if you want to send a structure from matlab to c#, you can declare it in your c# assembly. then you can create within matlab a new reference of this struct type, fill it, and send it to ac# function

You can't pass MATLAB structures to methods of a .NET assembly. Store the relevant information in either MATLAB arrays or cell arrays, and design your C# to accept it in that form.

For examples of the use of .NET libraries from MATLAB, see the documentation section User's Guide->External Interfaces->Using .NET libraries from MATLAB, and particularly the sections Handling .NET Data in MATLAB and Using Arrays with .NET Applications , which cover how to pass data to and from .NET assemblies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM