Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

parameter value in figure titke

Status
Not open for further replies.

u01daj3

Bioengineer
Joined
Aug 29, 2005
Messages
1
Location
NL
Hi,
I would like to know if there is a way to 'print' a parameter value in the figure title.
At the moment I have the following statement:
Figure1=figure('Name',D. Jansen, M. bed sim xxxxx', ...
'NumberTitle','off', ...
'Position',[50 50 925 600] );
Instead of the xxxxx I would like to print the values of one or more parameter values (if possible with name).

Thanks in adavnce for any tips.
David
 
Yes, you can use the int2str and num2str functions. If you require specific formatting then you can use the sprintf function, which is rather complex but (for scalar arguments at least) works in exactly the same way as the equivalent C function.

e.g.
Code:
param_value = pi;
mystr = ['D. Jansen, M. bed sim ' num2str(param_value)];

% or
% mystr = sprintf('D. Jansen, M. bed sim %.4d', param_value);

Figure1=figure('Name',mystr, ...
                'NumberTitle','off', ...
               'Position',[50 50 925 600] );
M

--
Dr Michael F Platten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top