How do I obtain the inherited sampling rate of a discrete Simulink block from the MATLAB Command line?

3 views (last 30 days)
How do I obtain the inherited sampling rate of a discrete Simulink block from the MATLAB Command line?
I would like to use the sampling rate of a discrete Simulink block in calculations within a masked subsystem. The sampling rate of this block is -1 (i.e. inherited sample rate). How can I obtain the actual inherited sample rate of this block from the Command line (e.g 0.0025 instead of -1)?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 May 2010
You can determine the compiled sample time of any block in a model by first updating the model and then accessing the block's CompiledSampleTime parameter, using the GET_PARAM command. For example
get_param(gcb,'compiledsampletime') %where gcb is the block most recently clicked on
For more information regarding this parameter, please see the "Specifying Sample Time" section of the Simulink documentation
If you have the documentation installed, you may also view the same information using MATLAB's help browser by executing the following command at the MATLAB prompt:
web([docroot,'/toolbox/simulink/ug/f7-9753.html'])

More Answers (0)

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!