How can I have System.Console.WriteLine write to the MATLAB command window while using the .NET API in MATLAB 7.8 (R2009a)?
Show older comments
I have a C# .NET assembly (MATLABWriter.dll) project with the following code:
namespace MATLABWriter {
public class WriterClass {
public void Write() {
System.Console.Write("Hello, world!");
}
}
}
I have loaded the .NET DLL in MATLAB using the NET.addAssembly command:
>> NET.addAssembly("MATLABWriter.dll");
>> writerObj = MATLABWriter. WriterClass;
The Write() method has a call to System.Console.Write to write the specific text out to the command window.
However, if I execute the Write() method, MATLAB does not print the text:
>> writerObj.Write
Is there a way to write this text to the MATLAB command window?
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Microsoft .NET in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!