matlab 按钮调出另一个可操作gui,按一下按钮按下另一个按钮。(Make a button push another button. Matlab GUI)...

I'm building a GUI that shows images when I push a button, but there are a lot of images, and sometimes I want to jump over a number of images, so what I'm trying to do is, get a edit texbox, where I put the number of the image I want to go, push a button to push the other button until i get to the desired image. I want to make this way( pushing the other button x times to get to the desired image) because there are a bunch of parallel stuff happening at the same time the image is passing to the other.

so my code for the button is:

function pushbutton14_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton14 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

i = str2double(get(handles.edit4, 'String'));

while handles.counterN < i

pushbutton1_Callback(hObject, eventdata, handles);

guidata(hObject, handles);

end

So every time I push button 14, I want to get it to push the button 1, until the counter(which is added 1n every time button 1 is pushed) gets to the value in edit4.

But for some reason the guidata is not updated, so the counter always stays as 1.

I have guidata(hObject, handles); , in the end of the button 1 function... so I don't understand why is not updated, I also tried without guidata(hObject, handles); in the while loop

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值