MATLAB Answers


How do you place values in the cells of a empty table on a GUI?

I made GUI with a calculate button and a table; I want the results from the calculations to appear on the table. I would gladly appreciate and help, advice or link referral. thanks in advance

  댓글 수: 1

로그인 to comment.


답변 수: 1

Walter Roberson 님의 답변 4 Jun 2013
 채택된 답변

set() the 'data' property of the uitable to be a cell array containing the results.
There is no way at the MATLAB level to update only selected cells (there is if you go to the Java level), so you may need to get() the 'data' property in order to determine the current contents before you update it.

  댓글 수: 4

표시 이전 댓글 수: 1
cell_array = {'Hi', 'banana', 456; 34, 2345, pi};
this is what I think you mean:
but when i do this an error message occurs and states:
Undefined variable "handles" or class "handles.uitable3".
Error in GUI1>correctionModelworking1 (line 796) set(handles.uitable3,'Data',x)
Error in GUI1>Calculate1_Callback (line 384) [x, error, stat1, stat2, stat3] = correctionModelworking1(ExPath1,'true',2,'true');
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in GUI1 (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)GUI1('Calculate1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Yes, roughly. You need to make sure that handles.table is the graphics handle to the table. It should have a default name like what you thought it was, but for some reason, it has either been cleared or not been set.

로그인 to comment.

Translated by