How to disable an action button programmatically in Simulink mask?
    8 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
Hello, I'm actually looking for disable a button in a mask under conditions, it works well with parameters with the following code but when it is a button it doesn't work.
Name=get_param(gcb,'ModelName');
if strcmp(Name,'User defined')
  set_param(gcb,'MaskEnables',{'on','on'});
else
  set_param(gcb,'MaskEnables',{'on','off'};
end
My block has two parameters, the first one is called 'ModelName', it is a 'Popup' parameter with some names and one is 'User defined'. The second is currently an 'Edit' parameter but I want to change it or add a 'Button' action and enable it only if 'User defined' is selected.
Thanks for your help.
2 commentaires
  Gareth Lee
      
 le 20 Oct 2016
				can you show the diagram corresponding to block and mask interface(include the segment code)
Voir également
Catégories
				En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

