variable sweep in simulink
    12 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    nadav yanay
 le 13 Nov 2011
  
    
    
    
    
    Commenté : Marsia Hossen Konika
 le 5 Juil 2021
            How do I sweep the value of a "gain block" in simulink? can I do a few iterations, each one with different value in the gain block? Thanks
1 commentaire
Réponse acceptée
  Thijs
      
 le 13 Nov 2011
        in simulimnk change the name of the gain parameter to for example G. The value for G can then be specified from the workspace. So you can use a for loop like this one:
 gain=[1:20];
 for n=1:length(gain)
  G=gain(n);
  run('simulink_model_name')
 end
using parfor instead of for can improve performance if you have a multiple core machine.
hope this helps
1 commentaire
  Rahul Kumar
    
 le 15 Mai 2019
				Update: If you are using R2017a or later, the parsim command can be used to set this up very easily.
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange
			
	Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



