Main Content

Global Variable Representation

Control global variable representation by using storage classes

Control the representation of a global variable in the generated C/C++ code by assigning it a storage class. For code generation, a storage class is a specification that determines the declaration and definition of a variable in the generated code. Storage classes help you to integrate generated code with external code. For code generation from MATLAB® code, you can use storage classes with global variables only. To assign a storage class to a global variable, in your MATLAB code, use the coder.storageClass function.


coder.storageClassAssign storage class to global variable