Effacer les filtres
Effacer les filtres

Which is best :define variables as global or pass them as arguments?

1 vue (au cours des 30 derniers jours)
nedjma ALI
nedjma ALI le 26 Mai 2013
Hello everyone, I would like to know which is best: To define variables global in main & function like global var1, var2 or pass then as arguments to function like [out1]=functionName(var1,var2)

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 26 Mai 2013
Passing them as argument is better

Plus de réponses (1)

Image Analyst
Image Analyst le 26 Mai 2013

Catégories

En savoir plus sur Introduction to Installation and Licensing 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!

Translated by