GUI Uitable: set column data to variable
조회 수: 4 (최근 30일)
이전 댓글 표시
Hey, all, thanks for reading this,
I set up a GUI uitable with some data, and I would like to use that data in another callback function. I was wondering, how do I select data on a column by column basis in other callback functions and assign it locally to variables?
Thanks for your advice
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2012년 8월 6일
% i am not sur that i have understood
data=get(handles.uitableName,'Data')
%data is a cell array, then extract any column you want
c1=data(:,1) % the first column
댓글 수: 2
Taral Shah
2014년 9월 16일
data=get(handles.uitableName,'Data') If we do this, it extract all the data from table.Is there any way that i can extract selected data (highlighted) only?
추가 답변 (1개)
Seyhan Emre Gorucu
2012년 8월 6일
편집: Seyhan Emre Gorucu
2012년 8월 6일
Hello,
You need to assign a CellEditCallback function to the table. You can do it both programmatically and from the guide. Once you change something on any editable column, it should go that function. You can get all the data from
get(eventdata,'Data')
You can also get other information via
Indices.Indices
Indices
This would be something like:
mytable_CellEditCallback(eventdata,Indices)
get(eventdata,'Data')
Indices.Indices
Indices
end
Don't forget the assign the function first.
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!