Different length character in graphical interface set(hObject)

조회 수: 1 (최근 30일)
Benjamin LECLERCQ
Benjamin LECLERCQ 2017년 11월 16일
답변: Benjamin LECLERCQ 2017년 11월 24일
Hi,
I want to define the text options (String) of a GUI matalb dropbox menu directly in the code, not using the toolbox changing the String field. I also want to use special characters such as _ and strings that have a different length.
This is the code I use in the 2017 version
test=["A_";"B";"C"];
set(hObject,'String',test)
But unfortunately I need to use R2014a and " " are not usable in this version, is there another way to display the characters ? or another method to set the string ?
Thanks Benjamin

채택된 답변

PG_Dev
PG_Dev 2017년 11월 21일
편집: PG_Dev 2017년 11월 24일
Benjamin
Does this work?
test= {'A_';'B';'C'};
set(hObject,'String',test);

추가 답변 (1개)

Benjamin LECLERCQ
Benjamin LECLERCQ 2017년 11월 24일
Yes it works thanks a lot !

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by