필터 지우기
필터 지우기

How do I get information about selected column in UItable?

조회 수: 8 (최근 30일)
병주 김
병주 김 2022년 5월 16일
댓글: Geoff Hayes 2022년 5월 16일
First of all,
I would like to make matlab app as below in appdesigner
  1. Make table from data
  2. Select column from table I want to see
  3. Plot data which selected column from table.
So I tried to get event.Indices, but actually I don't know how to do that
Some colleagues replied that just use below kind of function, but matlab says no field named Indices like below fig.
Actually, I just would like to see how event.Indices are structed so that I use the structure to handle data.
Could you please help me out?
Thanks
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2022년 5월 16일
@병주 김 - I think the problem is that you are trying to get the Indices from the event object of the push button callback and not the UITable cell selection callback. I think that you want to do something similar to https://www.mathworks.com/matlabcentral/answers/364338-how-to-get-indices-of-selected-uitable-cell-outside-cellselection-callback (which I see you have commented on) so that the cell selection callback does the following
% (Add selectedCell property to store indices)
% Cell selection callback: UITable
function UITableCellSelection(app, event)
app.selectedCell = event.Indices;
end
and that your push button callback would then get that data and use it to plot
function CallbackButtonPushed(app, event)
% get the data from the table using app.selectedCell
% plot the data
end
So you still need two callbacks - one to save the selected columns, and one to plot the data.

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

답변 (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