Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Array Dimension as a Macro
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
karthikeyan

Posts: 15
Registered: 1/12/09
Array Dimension as a Macro
Posted: Jul 16, 2010 4:05 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.