Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross 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
Aug 29, 2005
1
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
 
Replies continue below

Recommended for you

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