isglobal

Returns a logical indicating whether the input is global in scope.

Syntax

R = isglobal('var')

Inputs

var
Name of the variable(s) to be tested.
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | string | vector | matrix

Outputs

R
Logical value.

Example

Global logic test:

global A
A = 2;
isglobal('A')
R = 1