I had a similar problem but could find on suitable solution online.
One can inactive buttons and other objects temporarily using the Enable property. In my application, I have a function that takes lot of time to complete, and I don't want the user to click anything until the result has been returned.
I make this possible, I found all the object that are currently active and inactivated them prior to the function call, and then reactivated them once the function had been executed
Before the function call: h = findobj(gcf,'Enable','on'); set(h,'Enable','inactive');
After the function call: set(h,'Enable','on');
Hope this helps
Mads