How to show the Unit parameter in the signal attrbutes of a constant block?
    3 ビュー (過去 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?

0 件のコメント
採用された回答
  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
 2022 年 3 月 2 日
				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
      
      
 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 Center および File Exchange で Programmatic Model Editing についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



