URGENT! How to use Edit Text (Enable, 'Inactive') or List Box as a display

조회 수: 5 (최근 30일)
Jethro
Jethro 2012년 1월 19일
Hi everybody!!
I have to set an edit text area enabled as inactive as a display:
I have my statistics about data I read in a previous figure and I have to display them in this space when I push on a button or I choose a voice from a popup menu. I know how to set handles, but every time I tried, an error said to me that it was impossible to show multiline elements in an edit text, but I saw it is possible!!!
I have to show something like
"The max value in this statistic is ( value )
The min value in this statistic is ( value )
The mean value is equal to ( value )
...
...
..."
In the same space I'd like to publish a sort of table made by arrays, but I'd like that the entire row is user selectable... Can I set the same Edit Text or should choose a ListBox ? And if I have to choose a ListBox, how can I fill it???
  댓글 수: 4
Walter Roberson
Walter Roberson 2012년 1월 19일
Urgent is when the nuclear reactor containment system is about to collapse. Or when I've run out of chocolate.
Jethro
Jethro 2012년 1월 19일
This is like your chocolate for me, now, because my university career dipends on it lol!

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

답변 (2개)

Walter Roberson
Walter Roberson 2012년 1월 19일
You have to set the Max property of the control to be greater than 1.
It is not simple to select a row of an edit box and figure out which row you have selected. Listbox would be easier that way, or consider a uitable as that has a CellSelectionCallback property.

Jethro
Jethro 2012년 1월 19일
How can I put in a ListBox some datas I have in a var??
And to retrieve the selected line I have to use a switch function or is it "automatic"???
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 1월 19일
str2num() or sprintf() in order to construct a cell array of strings, which you then set as the String property of the listbox uicontrol.
To retrieve the selected line:
strs = get(TheHandle, 'String');
thisstr = strs{get(TheHandle, 'Value'));
Except that you need to add a layer of error checking in case the value property is [] .

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

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by