Getting multiple outputs in one time
    1 vue (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
I have a function stiff(k), which outputs a matrix. I want to output stiff(k) for k=1 to 20, but I'm only able to do it by writing out each individul k value. Is there  more efficient way to do this?
0 commentaires
Réponses (1)
  Torsten
      
      
 le 12 Déc 2022
        A = arrayfun(@(k)stiff(k),1:20,'UniformOutput',0)
function out = stiff(k)
  out = k*[1 2 3;4 5 6];
end
0 commentaires
Voir également
Catégories
				En savoir plus sur Get Started with MATLAB 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!

