GUIDE uita​ble_CellSe​lectionCal​lback エラー

1 次查看(过去 30 天)
GUIDE Tableコンポーネントで、セルを編集(CellSelectionCallback )すると、下記のエラーが発生します。
解決策を教えていただけると幸いです。
「try~catch」文で回避していますが、エラーを解決したいです。
◯エラー
インデックスが行列の次元を超えています。
エラー: GraphSet2>uitable1_CellSelectionCallback (line299)
if selection(2)==1;
エラー: gui_mainfcn (line 95)
feval(varargin{:});
エラー: GraphSet2 (line 42)
gui_mainfcn(gui_State, varargin{:});
エラー:
@(hObject,eventdata)GraphSet2('uitable1_CellSelectionCallback',hObject,eventdata,guidata(hObject))
Error while evaluating Table CellSelectionCallback
◯コード
unction uitable1_CellSelectionCallback(hObject, eventdata, handles)
% hObject handle to uitable1 (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.CONTROL.TABLE)
% Indices: row and column indices of the cell(s) currently selecteds
% handles structure with handles and user data (see GUIDATA)
VariableList=handles.VariableList;
data1=handles.data1;
table = get(handles.uitable1,'Data');
selection = eventdata.Indices;
% try
if selection(2)==1;
[V,~]=listdlg('ListString',VariableList,'SelectionMode','single');
Vlabel=VariableList(V);
V=data1(:,V);
Vmin={round(min(V))};
Vmax={round(max(V))};
table(selection(1),1)=Vlabel;
table(selection(1),2)=Vmin;
table(selection(1),3)=Vmax;
set(handles.uitable1,'Data',table);
else
return
end
% catch e
% e;
% end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 GUIDE アプリの移行 的更多信息

产品


版本

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!