Clear Filters
Clear Filters

Load txt data into popupmenu

1 view (last 30 days)
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
fauzan ishaq
fauzan ishaq on 21 Jan 2017
i also search about that please tell hot to do that
Walter Roberson
Walter Roberson on 21 Jan 2017
The Answer given below is fine.

Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 21 Nov 2013
a=num2cell((1:5)')
set(handles.popupmenu1,'string',a)
  2 Comments
SYED AZHAR
SYED AZHAR on 12 Feb 2018
if u have text file like above and i want to populate into popup menu then how ?
Walter Roberson
Walter Roberson on 12 Feb 2018
a = num2cell( load('TheTextFile.txt') );
set(handles.popupmenu1, 'string', a);

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps 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!