linking m-files togeher
Afficher commentaires plus anciens
Is it possible to link 2 seperate m-files where both m-files has their own function with different saved name?
1 commentaire
per isakson
le 10 Juin 2015
What exactly do you mean by "link 2 seperate m-files" ?
Réponses (1)
dpb
le 10 Juin 2015
0 votes
You don't actually "link" m-files together, you create a script (or another function) that calls the two successively. Or, if they're always used together but it's handy for factorization to have them as two functions, the one which is called by the other can become a subfunction within the same file. In this case that second function is not visible outside the file, however, only accessible to the primary function in the file. This may (or may not) be the behavior desired; all depends on your needs.
4 commentaires
Steven Chong
le 10 Juin 2015
Walter Roberson
le 10 Juin 2015
if rand() > 0.5
name_of_first_file;
else
name_of_second_file;
end
Steven Chong
le 10 Juin 2015
Walter Roberson
le 10 Juin 2015
if value_to_test == 1
name_of_first_file;
else
name_of_second_file;
end
Catégories
En savoir plus sur Files and Folders dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!