From: Michele on
Hi

I am starting to compile my own matlab function but I cannot display text on screen.
I have a function that load data, elaborates them and then is supposed to print some lines of text and produce some plots. Everything works fine in matlab but after the .m is compiled (using deploytool and Microsoft Visual C++ 2008 Express) there is not text output (whereas all the plots are produced).
I have even tried with something (much) easier

function test
disp('hello world')


but after this is compiled I get no output. What command should I use instead of 'disp' to display what I want on screen?

I am using R2010a on Win7 x64.

Thanks

Mike
From: ImageAnalyst on
Mike:
disp() does work, at least with WinXP (I know - I do it). It displays
to the operating system's command window that pops up when you run the
program. If you suppressed display of that window (with the
appropriate compiler option), you won't see it. Try running your
executable program from your MATLAB command window with the ! operator
and see if it shows up there.
-ImageAnalyst

From: Michele on
Thanks for the reply,

to be honest I compiled it using the default options on deploytool (just create a project add a matlab m file and click build). I tried executing the file in Matlab command windows with ! and everything works fine...but still the point of compiling is that the program should be working on a machine where matlab is not installed (but where MCR is)..
Do you know any command that can print stuff on screen other than disp?

Thanks again

M
From: Steven Lord on

"Michele " <ebola(a)quipo.it> wrote in message
news:hutn4s$nm5$1(a)fred.mathworks.com...
> Thanks for the reply,
>
> to be honest I compiled it using the default options on deploytool (just
> create a project add a matlab m file and click build). I tried executing
> the file in Matlab command windows with ! and everything works fine...but
> still the point of compiling is that the program should be working on a
> machine where matlab is not installed (but where MCR is)..

It is.

> Do you know any command that can print stuff on screen other than disp?

There is no Command Window in a deployed application, so DISP displays to
the DOS window (or nowhere if you suppress that window.) Where would you
expect the output of DISP to be displayed in the case where you suppress the
DOS window?

If you're looking to display some text (like the output that would be
displayed when you display a variable) in a GUI, look at EVALC or SPRINTF.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com