I received a task to visualize an array from program, that is being debugged in VS. Is there any way to connect to Visual Studio debugging session from external program and get data from it?
Theoretically, you could use the Debugger.GetExpression API to read the values from the debugger and send them to MATLAB, but if we're talking about a relatively large amount of data (such as a large matrix or vector), the chances of this solution having reasonable performance are rather slim.
An easier solution could be to just take advantage of the fact you can call your own methods from the debugger - define a method in your code that sends the data to MATLAB, make sure it's defined in the same place where the data-structure you're serializing is defined (so that the debugger won't complain about accessibility issues), and then just execute that method from the Watch or Immediate windows.