MATLAB: Declare global variable in simulink

global variableMATLAB and Simulink Student Suitesimulink

In Simulink,I need to use one of the inputs to a function block in another saved function. So I want to decalre this input as global in the simulink but once i do that I get the following error.
Global declaration not resolved to a Data Store Memory block registered via the Ports and Data Manager.
Here the variable R is given as input and I want to declare this as a global variable and use it in a function which I am using in this model.

Best Answer