From: Rob Ing on
Hi,

I want to output a variable in a warndlg box. How can i do this? I cant seem to work it out nor find anything on the internet about it.

Cheers
Rob
From: Steven Lord on

"Rob Ing" <ringham3(a)hotmail.com> wrote in message
news:hqtapd$4vn$1(a)fred.mathworks.com...
> Hi,
>
> I want to output a variable in a warndlg box. How can i do this? I cant
> seem to work it out nor find anything on the internet about it.

Something like this?

x = 73;
warnstr = sprintf('The value of x is %d, which is outside the range [0,
1].', x);
warndlg(warnstr, 'X outside acceptable range')

The MAT2STR and/or EVALC functions may be of interest to you as well.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ