Load txt data into popupmenu

Hello:
I have a txt like this:
1
2
3
4
And I would like to load this 4 lines into a popupmenu (popupmenu1).
How can I would do this??
Thanks for your attention.

2 Comments

i also search about that please tell hot to do that
The Answer given below is fine.

Sign in to comment.

 Accepted Answer

a=num2cell((1:5)')
set(handles.popupmenu1,'string',a)

2 Comments

if u have text file like above and i want to populate into popup menu then how ?
a = num2cell( load('TheTextFile.txt') );
set(handles.popupmenu1, 'string', a);

Sign in to comment.

More Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!