if nested functions supported in live scripts
Show older comments
Are nested functions supported in live scripts? Otherwise, global variables have to be declared as global?
6 Comments
Dyuman Joshi
on 27 Feb 2024
"Are nested functions supported in live scripts?"
Yes.
"Otherwise, global variables have to be declared as global?"
global variables always need to be declared as global.
feynman feynman
on 27 Feb 2024
Dyuman Joshi
on 27 Feb 2024
Which functions gave you the error? And what was the error they gave?
feynman feynman
on 27 Feb 2024
Edited: feynman feynman
on 27 Feb 2024
Dyuman Joshi
on 27 Feb 2024
A function needs to be called by using its name and providing any inputs required to run it. That is the case in both functions (.m) and live functions (.mlx).
If, a function does not require any input to run, you can run it (.m file) by pressing the green button.
However, that is not the case with live function (.mlx file), for which you need to explicitly call it.
feynman feynman
on 27 Feb 2024
Accepted Answer
More Answers (0)
Categories
Find more on Whos 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!