Check if push button has an image on it or not
    6 views (last 30 days)
  
       Show older comments
    
    Hao Wei Low
 on 23 Apr 2015
  
    
    
    
    
    Commented: Hao Wei Low
 on 23 Apr 2015
            I have a bunch of push button where the user can put pictures on but how do I check if the push button has an image on it or not? Below is the code I thought would work but wouldn't. Any help is greatly appreciated.
if (handles.pushbutton1,'cdata',[]) || (handles.pushbutton2,'cdata',[])
     msgbox('There are still empty tiles')
end
0 Comments
Accepted Answer
  Michael Haderlein
      
 on 23 Apr 2015
        You need to use get and isequal:
if isequal(get(handles.pushbutton1,'cdata'),[]) || isequal(get(handles.pushbutton2,'cdata'),[])
%...
end
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!