MATLAB: [GUI] How to make a push button move when i click on it

clickguiguidemovepushbutton

Hi, I started to use GUI 2 weeks ago, so I'm pretty new to it. I'm using GUIDE to make a game. I'm wondering how to make a pushbutton move upwards for a little bit every time I click on it? BTW I'm very confused by the concept of handles and I've been searching for solutions for so long and cannot find one, so I'm here for some help. I appreciate all the helps you give. Please save my life! This is my homework!

Best Answer

Set the following in the push_button callback function.
new_position_array = [20 20 20 20]; % example of new position
set( handle.my_push_button,'Position', new_position_array )