how to manage inputs in a dialogbox

2 次查看(过去 30 天)
sanky kumar
sanky kumar 2013-9-11
prompt={'Enter the matrix size for x^2:',... 'Enter the colormap name:'};
name='Input for Peaks function';
numlines=1;
defaultanswer={'20','hsv'};
answer=inputdlg(prompt,name,numlines,defaultanswer);
IN THIS CODE INSTEAD OF using "defaultanswer" how to leave the textbox blank & also where will we see the stored answers ?

回答(1 个)

Arthur
Arthur 2013-9-11
To leave the textbox blank, you can either do this:
defaultanswer = {'',''};
or this
answer=inputdlg(prompt,name,numlines);
You will find the answers in, well, answer. This will be a cell array, with answer{1} being the inserted string in box 1, and answer{2} the contents of box 2.

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by