Real time communication and debugging between Matlab and Visual Studio C# .NET

5 views (last 30 days)
Hello,
we would like to create communication with debugging possibilities between Matlab and C# Visual Studio. The following example illustrates our goal:
What we would like to do:
  1. .Net calls a Matlab .m script (which is active in Matlab Editor and contains break points)
  2. Inside this running .m script, Matlab calls back to the .Net application
  3. .Net application returns a non static value
  4. Matlab returns the result
What we have already tried:
  1. We have achieved this two-way communication with deploying our Matlab script to .Net Assembly (with Matlab NE Builder). This assembly was included to the .Net application. Unfortunately debugging is not possible this way.
  2. We tried to create COM Matlab object on .NET Side, in order to execute functions in Matlab. However we did not find any possible way to call the same instance of the .NET Application back from Matlab. We also tried this solution in hopes of debugging possibilites.
Any help, comments, suggestions would be appreciated. Thank you very much in advance.

Answers (1)

Manda Pavan kumar
Manda Pavan kumar on 27 Jan 2022
Hi Have u found a solution as I am also trying to do this kind of thing but i am. Unable to do so.. Can u help me with it?
  1 Comment
Vikas
Vikas on 6 Jun 2022
I will suggest you to debug each step in Visual Studio
By calling matlab script in VS you can easily debug it's output and C# code output also.
If you are new to C#/VS you can check this guide
As Visual Studio debugging is excellent, you can view output of each line of executed code.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!