Execute a list of functions
    13 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
How do I store a list of user-defined function in an array and execute it in a loop one by one?
[d] = func1(a), 
[e] = func2(b), 
[f] = func2(c) ...
0 Commenti
Risposta accettata
  Walter Roberson
      
      
 il 2 Nov 2016
        myfun = {@func1, @func2, @func2} ; 
vars = {a, b, c};
for K = 1 : length(myfun)
   result{K} = myfun{K}(vars{K});
end
Vedere anche
Categorie
				Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
			
	Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

