Calling a script within another script
Mostra commenti meno recenti
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 Commenti
KSSV
il 8 Mar 2017
script in the sense a function?
Adam
il 8 Mar 2017
What is in script2?
Jan
il 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
il 9 Mar 2017
Risposta accettata
Più risposte (1)
Walter Roberson
il 8 Mar 2017
2 voti
You should get rid of the "clear" statements in your scripts.
1 Commento
Sanjit Ganti
il 9 Mar 2017
Categorie
Scopri di più su Scope Variables and Generate Names in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!