deactivate ButtonDownFcn ? stupid question
4 次查看(过去 30 天)
显示 更早的评论
Hey Guys,
stupid Question: I have created a function(pushbutton) with the ButtonDownFcn to work with my Plot. Its task is to zoom in everytime i click on the plot. Now is there a way, to deactivate the ButtonDownFcn ? so i can click on a plot without triggering the fcn ?
0 个评论
采纳的回答
Joakim Magnusson
2014-8-11
Maybe you can have for example a radio button. In your buttonDownFcn you can have an if statement to check if the radiobutton is activated or not. If it's not activated you will zoom, and if it is activated you won't zoom.
4 个评论
Andy L
2014-8-11
编辑:Andy L
2014-8-11
%%callback to radio button Zoom on
% Turn off other radiobutton
zoom on; % Turn Zoom On.
zoom reset; % Set axis for zoom out.
%%callback to radio button zoom off.
% Turn off other radiobutton
zoom out; % Zoom out to "zoom reset" axis.
zoom off; % Turn zoom off.
This eliminates the need for a push button.
更多回答(1 个)
Adam
2014-8-11
Can you not just turn your push button into a toggle and have it set ButtonDownFcn to [] if it is currently set to whatever you usually set it to?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!