For my final project I am doing some actions within a GUI. My GUI has
three panels and in one of these panels I would like to show the
console output.
It means that, I want to have a component like static text field(or
something similar) in one of the panels in the GUI and then show the
Matlab console output in that static text field.
For instance, when you run a Matlab code, the result will be printed
in the Matlab console, so I want to re-direct this output into my
static text filed within my GUI panel.
does anyone know how to do this...I really appreciate your help.
- Hamid
HELP EVALC.
--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
The command executes as: system('compiled_application [args]'), with a bunch of print statements compiled in.
My understanding of evalc is that it will only return the output after the command has finished executing, which isn't helpful.
Nate W.
If you are on a unix-like system, you could redirect output to a named pipe and open that pipe in the GUI as a file. Note that you would be at the mercy of when the application decided to flush its output buffer.
On MS Windows, XP SP2 or later should in theory have equivalent functionality, but I haven't tested that and I don't know how to create named pipes in Windows.
Redirecting output to a file would also be fine on unix-type systems, as long as the GUI knew and worked with the fact that EOF would only mean "got to the end of what is in the file so far" rather than "the process is finished writing and there isn't anything else to come".
Redirecting output to a file on an MS Windows system has the practical problem that Windows complains when you attempt to open a file that is open for writing in a different process. I don't understand why Windows does that, since XP SP2 and later claim to be POSIX compliant and that behaviour is not POSIX compliant, but it is a fact of life on Windows. There are apparently Windows programs to "unlock" files even when they are in use.