Calling a script within another script
Show older comments
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 Comments
KSSV
on 8 Mar 2017
script in the sense a function?
Adam
on 8 Mar 2017
What is in script2?
Jan
on 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
on 9 Mar 2017
Accepted Answer
More Answers (1)
Walter Roberson
on 8 Mar 2017
2 votes
You should get rid of the "clear" statements in your scripts.
1 Comment
Sanjit Ganti
on 9 Mar 2017
Categories
Find more on Scope Variables and Generate Names in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!