How can I get the data size/length from a signal in Simulink?

2 次查看(过去 30 天)
I'm currently trying to get the size/length of data from a signal in Simulink. I've already tried the Probe Block, but this only gave me the width of the signal. I'm trying to determine whether I've got 'single' or 'double' data on the signal. This should give me either 4 or 8 as the size/length based on the number of bytes.

回答(1 个)

Dimitris Kalogiros
Dimitris Kalogiros 2018-7-18
Hi Tim
Try Display -> Sihnals & Ports -> Port Data Types
This forces simulink to show up the data type of block's ports
  1 个评论
Tim Leschinsky
Tim Leschinsky 2018-7-18
Thanks for your answer, but I want to have the type itself as a signal. This way I can let this signal then go into, let's say a Switch-Case block, and this block then uses it during runtime. I want to have it dynamically because the data type can change and I want my model to adapt/react to that change.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by