How can I access the logical column data to uncheck the logical cells in uitable?

조회 수: 1 (최근 30일)
I have created a uitable with logical column with some other numeric columns. How do i uncheck the previously checked logical cell when another logical cell is checked without clicking the cell? I want to do it programmatically.I am unable to figure it out. Please help me out.

채택된 답변

Walter Roberson
Walter Roberson 2018년 10월 19일
The CellEditCallback() will be executed when the user clicks to change a value. Your callback can arrange to zero out other values as appropriate.
  댓글 수: 2
Yasho Bharat Boggarapu
Yasho Bharat Boggarapu 2018년 10월 19일
Actually , the logical cells are empty cells . So if we want to uncheck the logical cell, we need to make it empty, which is creating the problem. I am not able to assign an empty cell to a logical cell in this callback.
Walter Roberson
Walter Roberson 2018년 10월 19일
"the logical cells are empty cells"
Make them logical instead. For example,
h = uitable('ColumnFormat', {'logical'}, 'Data', {false;true;false;false},'ColumnEditable', true)
If there is some reason why you must use cells that are empty for false or logical(1) for true, then assign [] to the cell:
h = uitable('ColumnFormat', {'logical'}, 'Data', {[]; []; true; []}, 'ColumnEditable', true);
pause(3); %just for display purposes so you can see the change
h.Data{3} = [];

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by