Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
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?

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 1 Juin 2021
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 commentaires
Healey Montague-Alamin
Healey Montague-Alamin le 2 Mar 2022
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 le 2 Mar 2022
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Tags

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by