simulate a variable from 0 to 255 in simulink
1 回表示 (過去 30 日間)
古いコメントを表示
I need to simulate a variable from 0 to 255. And after they return from 255 to 0 and so continuously, all in simulink. I need this to simulate a variable "pv" signal processing (level control)
thanks
1 件のコメント
Fangjun Jiang
2011 年 7 月 2 日
You want the pv value increase by 1 from 0 to 255 and then come back. What is the time vector? Every 1 second change from 1 to 2, or every 1ms from 1 to 2?
採用された回答
C.J. Harris
2011 年 7 月 1 日
This setup should do what you need:
Create a constant (1 for example), feed that into an integrator block, then feed that into the 'mathematical function' block (set to 'mod'), and set the second input to 255.
Increasing or decreasing the first variable will control how fast your variable counts up.
2 件のコメント
C.J. Harris
2011 年 7 月 4 日
Your image doesn't work, but all that warning is saying is that if you are using a fixed step solver your simulation time should be a multiple of your step time.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Configure and View Diagnostics についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!