Why does running a script cause a memory error, while running the same script as a function does not?

I have found that running a script as a script by simply calling it from the command line causes a memory error, yet, running the same script as a function does not. Does anyone know why this is the case?

5 个评论

We can't know why immediately. You haven't shown us the script/function that proves that it is true.
That would be handy, but the script that generates the error is quite long (~1000 lines), I'll try to find a simpler approach that replicates the issue.
How do you run a script as a function? Did you edit the m-file?

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 File Operations 的更多信息

提问:

2016-2-2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by