Where can I find syntax related with 'Simulink.Parameter', 'Simulink.Signal' and 'Simulink.CoderInfo'
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Peter O
2020-3-11
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!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!