Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Array Dimension as a Macro
Posted:
Jul 16, 2010 4:05 AM


Basically, I am looking forward to generate the code to have an array size of the global signal as a #define constant(for e.g int32 my_signal[ARY_SIZE];).
To define the mpt signal for my_signal, mpt.Signal (handle) RTWInfo: [1x1 mpt.CustomRTWInfoSignal] Description: '' DataType: 'int32' Min: Inf Max: Inf DocUnits: '' Dimensions: [1 10] Complexity: 'real' SampleTime: 1 SamplingMode: 'Sample based' InitialValue: 'ones(1,10)'
in which the dimension and size of Initial Value should be equal.
To define the mpt parameter for ARY_SIZE, mpt.Parameter (handle) RTWInfo: [1x1 mpt.CustomRTWInfoParameter] mpt.CustomRTWInfoParameter StorageClass: 'Custom' Alias: '' CustomStorageClass: 'Define' CustomAttributes: [1x1 SimulinkCSC.AttribClass_mpt_Define] Description: '' DataType: 'uint8' Min: Inf Max: Inf DocUnits: '' Value: 10 Complexity: 'real' Dimensions: [1 1]
For the above definition, the signal declaration will become like int32 my_signal[10]; if code generated using ert.tlc
I am interested in the defining the array size as a #define(macro) constant for the signal.
Question : Where do I tweak the mpt object to obtain the array size as another constant?



