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

조회 수: 1(최근 30일)
Diaa
Diaa 2021년 5월 31일
댓글: Fangjun Jiang 2022년 3월 2일
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
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개)

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by