View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Managing Deployed Application Output with Message Handlers

Be the first to rate this file! 5 Downloads (last 30 days) File Size: 2.81 KB File ID: #30567 Version:

Managing Deployed Application Output with Message Handlers


Peter Webb (view profile)


28 Feb 2011 (Updated )

Example code for "Managing Deployed Application Output with Message Handlers".

| Watch this File

File Information

Demonstrates how to redirect the output of a MATLAB-Compiler generated application to a log file.

Required Products MATLAB Compiler
MATLAB release MATLAB 7.2 (R2006a)
Other requirements C compiler
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
24 Apr 2012 Christian


thanks for this submission.

It works just fine for a command line application. However for a GUI application I can't suppress the command window compiling with log.c.

Can you please advice what needs to be changed in log.c (and possibly also in the mbuild-command?) to suppress the command window for Windows GUI applications?

Thank you


Comment only
19 Aug 2011 Peter Webb

Peter Webb (view profile)


The MATLAB Compiler generates libmsgfcn.h and libmsgfcn.lib. And yes, this will be a topic for a future blog post (to be published in Sept. or Oct. 2011, most likely).

Comment only
09 Jun 2011 Russ

Russ (view profile)

Hi Peter,

This looks like a very interesting way to redirect the output streams in deployed applications, however, the ZIP file available for download does not appear to include the libmsgfcn.lib and libmsgfcn.h files. Could you advise me where to locate these files please.

Your example here seems to relate to output redirection when calling the shared libary from a standalone C application - is it possible to achieve a similar effect when calling the shared library from a .NET applicatation? I am are running in to problems when the compiled Matlab code tries to output text to the console (i.e. standard output stream) which causes the .NET application to throw an exception.

The only advise I have been able to find online for redirecting streams is to use evalc() in the compiled code, however, this is not very elegant.

Do you have any plans to elaborate on this important subject in one of your excellent blog posts?



Comment only
01 Sep 2016

Updated license

Contact us