필터 지우기
필터 지우기

get value in cell inside uitable by click on that cell

조회 수: 2 (최근 30일)
muhammad zulhelmy
muhammad zulhelmy 2017년 3월 5일
답변: MITAKSHI NIMJE 2019년 9월 19일
i read an excel and display at uitable2 using GUI MATLAB.
how can i get the value only for specific cell when i click into that cell in uitable2.
  댓글 수: 2
muhammad zulhelmy
muhammad zulhelmy 2017년 3월 5일
please some1 help me, really urgent... :( :( :(
Jan
Jan 2017년 3월 5일
편집: Jan 2017년 3월 5일
If you are in a hurry, provide enough information. What is "an uitable2"? What does "get the value" exactly means? Posting the required details is much more helpful than a bumping.

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

채택된 답변

Jan
Jan 2017년 3월 5일
편집: Jan 2017년 3월 6일
I guess, that "uitable2" might be an uitable.
% [EDITED according to the comment, 06-Mar-2017 10:58 UTC]
function test
FigH = figure;
uitable('Data', rand(2, 3), ...
'CellSelectionCallback', @myCellSelectionCB);
handles.TextH = uicontrol('Style', 'Text', ...
'Position', [10, 300, 100, 28]);
guidata(FigH, handles);
end
function myCellSelectionCB(TableH, Event)
handles = guidata(TableH);
data = get(TableH, 'Data');
index = Even.Indices;
set(handles.TextH, sprintf('%g', data(index(1), index(2))));
end
Now the contents of the text field is set to the contents of the selected uitable element. If you provide more details about your existing code, it would be possible to post a better matching solution.
  댓글 수: 3
Jan
Jan 2017년 3월 6일
See [EDITED]
valerio raco
valerio raco 2019년 1월 26일
there is a typo.
Even.index should be Event.index.
otherwise, sweet answer. saved me tons

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

추가 답변 (1개)

MITAKSHI NIMJE
MITAKSHI NIMJE 2019년 9월 19일
I have a .xls file. I want to process data row wise in matlab gui.Can somebody help me.
for eg-
parameters given are date, time, height,volume, etc.
if i want to display average of the given parameters from date-21/6/19 time 0.30 to 21/6/19 ,8.00.

카테고리

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