You can use the command input
for this, combined with sprintf
.
%# set defaults
radius = 12.6;
%# ask for inputs
tmp = input(sprintf('Enter new radius value (R=%4.2f)\n',radius));
%# if the user hits 'return' without writing anything, tmp is empty and the default is used
if ~isempty(tmp)
radius = tmp;
end
As an alternative, you may want to look into INPUTDLG
Jonas
2010-05-08 13:21:38