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

조회 수: 2 (최근 30일)
takaka
takaka 2024년 5월 27일
편집: Fangjun Jiang 2024년 5월 28일
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
Sanju
Sanju 2024년 5월 27일
Can you please share your model?
takaka
takaka 2024년 5월 27일
This is the simplified model.
Best,

댓글을 달려면 로그인하십시오.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 5월 27일
편집: Fangjun Jiang 2024년 5월 28일
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.

카테고리

Help CenterFile Exchange에서 Complex Logic에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by