[Simulink] How to change the type of the number in "chart"?
2 ビュー (過去 30 日間)
古いコメントを表示
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1704501/image.jpeg)
Best,
2 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!