How to get default values in pop up menu GUI
2 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Jan
2015-3-21
Do I understand correctly, that you want to set the 'Value'?
set(handles.popupmenu1, 'String', namepar('parametres.txt'), ...
'Value', 1);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!