Calling a script within another script
Afficher commentaires plus anciens
I am trying to call a script (say script2) within another script (say script1). But I have to declare a few variables in script1 before calling script2. When I try to do this, the script1 directly goes to calling script2, without declaring the variables in between. How to overcome this?
{clear
xq=2; yq=2;
script2}
4 commentaires
KSSV
le 8 Mar 2017
script in the sense a function?
Adam
le 8 Mar 2017
What is in script2?
Jan
le 8 Mar 2017
@Sanjit: Please do not invent an own syntax containing curly braces to explain code in the forum. Prefer standard Matlab syntax, because this is understood here in general.
Sanjit Ganti
le 9 Mar 2017
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 8 Mar 2017
2 votes
You should get rid of the "clear" statements in your scripts.
1 commentaire
Sanjit Ganti
le 9 Mar 2017
Catégories
En savoir plus sur Scope Variables and Generate Names 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!