Вопрос

I used the Matlab Compiler Deployment Tool for generate a compile project (generate a dll) that can be referenced in .net. In the .net project i call functions of Matlab through the dll, and i have results. But i want get the current workspace the Matlab. Is this possible? Any idea? I am using Visual Studio 2010 and Matlab R2009b.

This is part of the code:

Using MatlabPackageNative;

public static MatlabPackageNative.Files Matlab;
Matlab.initialVariables();
Matlab.function1();
Matlab.function2();
Это было полезно?

Решение

I have already the solution, the way is the next:

  1. Create a .m file (for example SaveWorskpace.m) con this information:

    save test.mat
    
  2. Add SaveWorskpace.m at the project with Matlab Compiler Deployment Tool.

  3. Compile the project with Matlab Compiler Deployment Tool
  4. Add reference at the c# project
  5. Call function SaveWorkspace()
  6. Ready, you have variables save in the workspace test.mat
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top