Effacer les filtres
Effacer les filtres

[Simulink] How to change the type of the number in "chart"?

2 vues (au cours des 30 derniers jours)
takaka
takaka le 27 Mai 2024
Modifié(e) : Fangjun Jiang le 28 Mai 2024
I want to make a simple countup model in "chart" block (state machine) like the attached picture.
However, there is an error when I simulate this model.
The problem is the types of the parameter 'cnt' and the added number "1" are different.
I set 'cnt' "fixdt(0,4,0)", so also want '1' to be fixdt(0,4,0), but I don't know how to set the type.
How can I do this?
Best,
  2 commentaires
Sanju
Sanju le 27 Mai 2024
Can you please share your model?
takaka
takaka le 27 Mai 2024
This is the simplified model.
Best,

Connectez-vous pour commenter.

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 27 Mai 2024
Modifié(e) : Fangjun Jiang le 28 Mai 2024
In the chart, add a data, specify the scope as "Constant", name it ConstantOne, specify its value and data type. It is a good practice not to use fixed numerical number.

Catégories

En savoir plus sur Complex Logic dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by