How to get default values in pop up menu GUI

2 visualizaciones (últimos 30 días)
Lolipop
Lolipop el 21 de Mzo. de 2015
Editada: Lolipop el 21 de Mzo. de 2015
Hi! I have read parameteres from .txt file to pop up menu with code:
set(handles.popupmenu1,'String',namepar('parametres.txt'));
Where namepar is function:
function out=namepar(nazivfile)
fid=fopen(nazivfile);
cac=textscan(fid,'%s','Delimiter','#');
fclose(fid);
cac=cac{1};
out=cac;
end
So after I ran my GUI I have listed parameters in my popupmenu1. Can I make that is always chosen first parameter, if I don't choose otherwise in my pop up menu when I start my program?

Respuestas (1)

Jan
Jan el 21 de Mzo. de 2015
Do I understand correctly, that you want to set the 'Value'?
set(handles.popupmenu1, 'String', namepar('parametres.txt'), ...
'Value', 1);
  1 comentario
Lolipop
Lolipop el 21 de Mzo. de 2015
Editada: Lolipop el 21 de Mzo. de 2015
All I want is just to be settled default value 1 so I don't need to choose any of parameters when I start GUI if I don't choose otherwise. And this your code is not working for me

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Report Generator en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by