How to create a dialog with multiple fields by using inputdlg on Mac?
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Charles
el 27 de Nov. de 2014
Editada: Image Analyst
el 28 de Nov. de 2014
It is the very first time I use Matlab on Mac. I am using Matlab R2013a on a Mac OSX 10.8.5.
I can create a simple dialog, with only one field, but I was not able to create a dialog with mutiple lines. I tried with my own programs but also with small toy examples I found in the tutorials.
For example:
I can run this:
if true
x = inputdlg('My single field dialog','dialog',1,'my single value');
end
But I can not run this:
if true
x = inputdlg({'field-1','field-2'},'dialog',1,{'value1','value2'});
end
I get the following error message:
Error using inputdlg (line 53) This function only accepts strings as its first parameter.
I can run inputdlg without any problem in my Linux machine.
Any help would be much appreciated!
Best regards
0 comentarios
Respuesta aceptada
Robert Cumming
el 28 de Nov. de 2014
on your MAC try:
which -all inputdlg
to check that you haven't got a function name clash anywhere...
What is line 53 in the inputdlg function?
1 comentario
Más respuestas (1)
Image Analyst
el 27 de Nov. de 2014
Did you look in the help and notice how they did it:
prompt = {'Enter matrix size:','Enter colormap name:'};
dlg_title = 'Input';
num_lines = 1;
def = {'20','hsv'};
answer = inputdlg(prompt,dlg_title,num_lines,def);
I'm sure you'll be able to adapt this with no problem.
3 comentarios
Image Analyst
el 27 de Nov. de 2014
I copied and pasted your exact code:
x = inputdlg({'field-1','field-2'},'dialog',1,{'value1','value2'});
and it worked fine. Are you sure that's exactly what you ran and not slightly different? If so, call the Mathworks because that should not happen.
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!