MATLAB: How to make ‘blue’ variable

'blue' variablesglobal variables

Hi all, I'm trying to make my own ImageViewer. Using some program as a template, I saw a lot of 'blue' variables in it (when I point on such variable there is a text "The scope of variable … spans multiple function").
Now I understood, that I want to use such variables also – in callback functions to update text, data, and so on.
How can I create such variables? Short explanation of what does it mean is appreciated as well. Thanks.

Best Answer

Keywords are in pure blue. Global variables are in cyan. You can just put the line
global myVariable;
in any function that needs to see the global variable. Other than that, just create it and use it like any other variable.