Where can I find syntax related with 'Simulink.Parameter', 'Simulink.Signal' and 'Simulink.CoderInfo'

2 visualizaciones (últimos 30 días)
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';

Respuesta aceptada

Peter O
Peter O el 11 de Mzo. de 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!
  1 comentario
DongWook Shin
DongWook Shin el 11 de Mzo. de 2020
Thank you so much.
I found what I want to know.
Now, I can handle each property of data object including Parameter, Singal, and Lookupdtable.
I'm going to configure fields of a block by applying set_param and get_param functions.
Thanks. :D

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Event Functions en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by