找回密码
 注册
关于网站域名变更的通知
查看: 245|回复: 2
打印 上一主题 下一主题

GUI 删除表格出错

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2020-9-17 16:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
代码+ h& t3 H" ?  X5 G$ E5 z/ B! H
function uitable1_CellSelectionCallback(hObject, eventdata, handles)
3 v+ B7 f0 [4 }" h- [  S% hObject    handle to uitable1 (see GCBO)6 r5 C# ~3 i" O5 P
% eventdata  structure with the following fields (see MATLAB.UI.CONTROL.TABLE)
) ~  l, u& G- `. O/ r# `& M! v%        Indices: row and column indices of the cell(s) currently selecteds
# C4 `, j* [5 ~! O- R/ F+ F% handles    structure with handles and user data (see GUIDATA)
4 i& {  A& a" g4 j3 ^newdata=get(h0bject,'Data');. s3 j4 m/ N, B8 O
hang=eventdata.Indices;
$ F2 E" b1 l0 K0 y4 Y* m) }! [hangIndex=hang(1);
  Y, H! i# w* m# {+ `handles.hangIndex=hangIndex;
5 W2 U1 i( _5 ^" ]; _9 U) Aguidata(h0bject,handles);- c  V2 }1 E6 ]  ?3 @" N% o
% --- Executes on button press in pb2.
5 ?, B& }( u, I! V9 [function pb2_Callback(hObject, eventdata, handles); \6 o7 S  `- t
% hObject    handle to pb2 (see GCBO)
, ^- m) v3 n  H( R; c% eventdata  reserved - to be defined in a future version of MATLAB- W6 F, E' B# }, G& H& b
% handles    structure with handles and user data (see GUIDATA)8 h; M. O( Q, p! ]
hangIndex=handles.hangIndex;4 |" r' R4 z' y, H
newdata=get(handles.uitable2,'Data');7 K' I0 d7 O9 Y' h
newdata(hangIndex,: )=[];
. n# q- G% i% K3 ^set(handles.uitable2,'Data',newdata);$ c) H) _. u  W. z$ p' X8 F2 \
save('newdata.mat','newdata');+ k0 X7 w& b' ?: _6 L6 p( U0 b: b
function uitable2_CellSelectionCallback(hObject, eventdata, handles); _; {5 u$ I3 m3 U7 ]9 Z( m; Q
% hObject    handle to uitable2 (see GCBO)
0 G2 W! \8 ~! o6 o% eventdata  structure with the following fields (see MATLAB.UI.CONTROL.TABLE)
" K3 L+ X/ K9 U* w. E: r%        Indices: row and column indices of the cell(s) currently selecteds
8 t- D* \3 U5 a7 G4 Z% handles    structure with handles and user data (see GUIDATA); _, L; W+ _4 ^$ z: ~
newdata=get(h0bject,'Data');) U7 L9 q* `: F- k! `. `, O
hang=eventdata.Indices;7 j9 b) J5 W$ ^9 s0 O4 @: R( v1 K& Y
hangIndex=hang(1);# c% t$ Q  V) B0 N: ]
handles.hangIndex=hangIndex;7 R* @" P) c( ]. U
guidata(h0bject,handles);
1 g& s( i! |1 _$ q# s% --- Executes on button press in pb4.
! P( J; F' X8 Vfunction pb4_Callback(hObject, eventdata, handles)5 ^4 n; y" |4 g; c( C  p
% hObject    handle to pb4 (see GCBO)8 j! w$ @4 J# ^
% eventdata  reserved - to be defined in a future version of MATLAB
& \+ S9 Y( D0 O# N. _% handles    structure with handles and user data (see GUIDATA)
) `) o% k4 V* l% E0 i( P5 changIndex=handles.hangIndex;6 {9 O$ O$ t2 G! W
newdata=get(handles.uitable2,'Data');
$ \/ q; Y6 c6 onewdata(hangIndex,: )=[];
+ ]0 n3 B& k$ l# u& \set(handles.uitable2,'Data',newdata);
# I- e0 L8 B9 s" m5 O  p: l. Jsave('newdata.mat','newdata');
% A( g1 R' x+ m- }5 W: }
- B/ t7 d1 t4 u: e/ M错误提示8 c! h8 q! x& S( B  x; Z
8 G7 A: p2 B! V
( e- D6 K. b2 L
出错! r8 {  [" Z+ k2 J' d
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)one4('pb2_Callback',hObject,eventdata,guidata(hObject))
& d6 T) W5 y: i) m* p# f计算 UIControl Callback 时出错。+ |, z* X& V3 M* n4 l
( m# }: K9 t4 o0 q
引用了不存在的字段 'hangIndex'。
4 C) L+ x% X: W# K! x5 }/ u5 S" Q4 x/ X- `7 A4 U1 B! h
出错 one4>pb4_Callback (line 146)
6 ^; {  T6 J( s9 _hangIndex=handles.hangIndex;
# w! J/ ^$ e9 W  v. j4 ^; Y) Y; G& k" h7 `
出错 gui_maiNFCn (line 95)& W- g- B9 I! ~' O! K
        feval(varargin{:});# d% |; o. v" ]5 _
8 u1 i. ^* j0 F/ e3 b1 Z+ T
出错 one4 (line 42)) c+ ]1 q- y, L9 C& M9 q6 Z
    gui_mainfcn(gui_State, varargin{:});5 X) t4 Q' {+ j1 H, w

" @- {. U3 `  g3 p4 s: i- d出错  g) y) J9 l2 M5 b
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)one4('pb4_Callback',hObject,eventdata,guidata(hObject))
) T3 U( _- g  \# _: a  j8 s计算 UIControl Callback 时出错。
2 R1 X. r$ A* f2 Y3 B- U+ c3 i

该用户从未签到

3#
发表于 2020-9-17 17:31 | 只看该作者
这么多错误啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-6-22 15:06 , Processed in 0.078125 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表