How to check if workspace is static

17 ビュー (過去 30 日間)
tommsch
tommsch 2021 年 1 月 18 日
回答済み: Srija Kethiri 2022 年 8 月 26 日
Is there a programmatic way to determine whether a workspace is static?
In particular, I want to add a variable to the callers workspace via assignin, if and only if the callers workspace is not static.
BTW: "Do not use assignin!" does not count as an answer.

回答 (1 件)

Srija Kethiri
Srija Kethiri 2022 年 8 月 26 日
Hi Thomas,
The workspaces for nested and anonymous functions are static. This means that all variables used within the function must be present in the text of the code. And there is no programmatic approach to find whether a workspace is static or not.
For more information on adding a variable to static workspace go through this documentation: Resolve Error: Attempt to Add Variable to a Static Workspace. - MATLAB & Simulink - MathWorks India
Hope this helps!

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by