Is there a workaround to have stdout in Matlab Standalone Applications?

In the page 27 of section 6 of the Matlab Compiler documentation ( http://www.mathworks.com/help/pdf_doc/compiler/compiler.pdf) states the following:
_You cannot return back values from your standalone application to the user. The only way to return values from compiled code is to either display it on the screen or store it in a file. To display your data on the screen, you either need to unsuppress (do not use semicolons) the commands whose results yield data you want to return to the screen or, use the disp command to display the value. You can then redirect these outputs to other applications using output redirection (> operator) or pipes (only on UNIX systems)._
It is not clear to me if using disp() and the output redirection ">" I could actually communicate (only on one direction) with other software.
This is the scenario where I want to use a Matlab Standalone Application:
  • From inside a software written in Qt, I would like launch a Matlab Standalone Application executable, passing an input argument to it. In general, this shouldn't be a problem. At least, I can launch external applications from my Qt software by just calling them with typical command line syntax:
myExternalapp.exe myParam
  • Once opened, the Matlab Standalone Application would take the input argument, which is a csv file, convert it to a matrix, and make a plot with it.
  • My doubt comes here: when I click in a certain point of my plot in the Matlab Standalone Application, I can visualize which x,y,z values correspond to that point. And what I want to do is: when I click on a point of the plot, send back the "x" value (for example) to my Qt application. Usually, with other external applications, what I do is send that values through the stdout, and take that stdout into the stdin of my Qt application. But in this case, since stdout is not available in the Matlab Standalone Application, I wonder what would be a possible workaround to make that happen. Maybe using disp() and redirect the output with ">" to the Qt application, but I'm not even sure how to mount that up.
Maybe the more experimented users can help me out here.
Thank you,
Raul

Answers (1)

Yes, disp(), and unsuppressed output, and fprintf() with no fileid or fileid 1, all send to stdout.
However, they might be buffered strangely, making it difficult for a pipeline to consume the results as they are produced.

Products

Asked:

on 25 Apr 2013

Community Treasure Hunt

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

Start Hunting!