Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Stdin and Stdout in Matlab standalone Applications

Subject: Stdin and Stdout in Matlab standalone Applications

From: ravilesp

Date: 25 Apr, 2013 14:18:09

Message: 1 of 2

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

Subject: Stdin and Stdout in Matlab standalone Applications

From: ade77

Date: 25 Apr, 2013 16:13:09

Message: 2 of 2

Why not just use your second option..
save the MATLAB values in a file, and let your external program (QT) read the file.
I don't know much about QT software

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us