Skip to content

isglobal

Test whether a variable is global.

tf = isglobal(A)

Returns true if the variable was declared with global in the current workspace. Detects whether the name shares storage with the global symbol table.

Note: globals are usually best avoided. Function arguments and explicit return values are clearer for most use cases.

global x;
x = 10;
isglobal(x) % 1