Load txt data into popupmenu

조회 수: 1 (최근 30일)
jose bernardo
jose bernardo 2013년 11월 21일
댓글: Walter Roberson 2018년 2월 12일
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
fauzan ishaq
fauzan ishaq 2017년 1월 21일
i also search about that please tell hot to do that
Walter Roberson
Walter Roberson 2017년 1월 21일
The Answer given below is fine.

댓글을 달려면 로그인하십시오.

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by