Load txt data into popupmenu

1 vue (au cours des 30 derniers jours)
jose bernardo
jose bernardo le 21 Nov 2013
Commenté : Walter Roberson le 12 Fév 2018
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 commentaires
fauzan ishaq
fauzan ishaq le 21 Jan 2017
i also search about that please tell hot to do that
Walter Roberson
Walter Roberson le 21 Jan 2017
The Answer given below is fine.

Connectez-vous pour commenter.

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by