Where can I find syntax related with 'Simulink.Parameter', 'Simulink.Signal' and 'Simulink.CoderInfo'
2 views (last 30 days)
Show older comments
hello.
I'd like to leran synteax related with 'Simulink.Parameter', 'Simulink.Signal' and 'Simulink.CoderInfo'
Below command defines attribute of paramter 'p1'.
Where can I learn these syntax(command?) more ?
p1 = Simulink.Parameter;
p1.Value = 1;
p1.DataType = 'uint8'
p1.CoderInfo.StorageClass = 'Custom';
p1.CoderInfo.CustomStorageClass = 'Struct';
p1.CoderInfo.CustomAttributes.StructName = 'ConstantInputData';
0 Comments
Accepted Answer
Peter O
on 11 Mar 2020
Check the documentation page:
Simulink Parameters function a little differently than standard MATLAB variables. Often, you'll get the impression that a Simulink-based data structure is really, really unnecessarily complex. This is partly to enable control/tuning/modification as Simulink runs. Parameters, for instance, are defined as tunable and non-tunable, which dictate how they can be changed in real-time or in different levels of a compiled simulation (either by the user, a function, MATLAB, or a Design Toolbox). The complex structure also allows for better specifications for Simulink Coder and the code autogenerators, bounds checking, and similar things you need to worry about if you're trusting a simulation to produce code that goes in stuff that people drive.
Simulink Blocks (type: blk = gcb and examine the structure), have a similar level of complexity and granular control. They also preserve a lot of the hierarchical information about a Simulink model. You can access/tweak the fields within Simulink Blocks through the set_param and get_param functions.
Hope this helps your understanding!
More Answers (0)
See Also
Categories
Find more on Event Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!