How to show the Unit parameter in the signal attrbutes of a constant block?

1 次查看(过去 30 天)
For the attached Simulink model I created using MATLAB R2021a, how can I show the Unit parameter in the block parameters of the constant block?

采纳的回答

Fangjun Jiang
Fangjun Jiang 2021-6-1
There is no "unit" property at the Constant block. What you can do is to define a Simulink parameter object.
A=Simulink.Parameter
A.Value=1
A.Unit='m'
And then in your Simulink model, specify the value of the Constant block as A and you can display "Port Units" in Simulink.
  3 个评论
Healey Montague-Alamin
Is there a replacement block for a constant block that automatically has a units parameter internally?
And does your solution allow for the unit conversion block to work?
Fangjun Jiang
Fangjun Jiang 2022-3-2
The Inport and Outport block support built-in unit specification. Once both sides have the unit specification, I think the Unit Conversion block can be applied to convert them automatically.

请先登录,再进行评论。

更多回答(0 个)

类别

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

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by