필터 지우기
필터 지우기

Printing data only in one colum of the table in MATLAB GUI

조회 수: 1 (최근 30일)
Rinachi Garg
Rinachi Garg 2012년 8월 3일
Hello,
I have a variable
sheetname = {'Apple'; 'Mango'; 'Banana'; 'orange'}
And the table in MATLAB GUI has two columns- col 1 in non editable, col2 is editable. I want to set the data in column 1 with sheetname variable.
I am not sure how to index the column number of the table in the following command and then assign the variable
I was trying to do following:
set(handles.uitable1,'String',sheetname)
But, it gives follwing error:
Error using hg.uitable/set
The name 'string' is not an accessible property for an instance of class 'uitable'.
Error in test3>fill_values_Callback (line 520)
set(handles.uitable1,'string',sheetname);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in test3 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)test3('fill_values_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Can anyone help me with this?
Thanks
  댓글 수: 1
Rinachi Garg
Rinachi Garg 2012년 8월 3일
set(handles.uitable1,'data',sheetname);
helps me in printing sheetname in the table but I can no longer edit 2nd table.
I don't know what going on. I have made second column editable. So, when I click on the cell in 2nd column- I can print the text but if I move to next cell then it gets erased.

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

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 3일
set(handles.uitable1,'ColumnName',sheetname);
  댓글 수: 3
Rinachi Garg
Rinachi Garg 2012년 8월 3일
And column 2 should still be editable
Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 3일
then
set(handles.uitable1,'RowName',sheetname);

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

카테고리

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