GLOBAL could be very inefficient

1 回表示 (過去 30 日間)
Federico
Federico 2011 年 10 月 25 日
I am using the GLOBAL instruction inside an if statement, to create a global variable only if it is needed. However, the code analyzer warns me that "GLOBAL could be very inefficient unless it is a top-level statement in its function".
What does this mean? Why is it slow? One of the most meaningful ways to interpret this that come into my mind is "GLOBAL is very slow of its own, don't use that in a loop". But this would imply that using it inside an if statement is ok (and thus the code analyzer should not be complaining at all).

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by