MATLAB Simulink communication in real time
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, In my simulink model I am reading a variable's value from MATLAB workspace. Now if I change that variable's value in workspace while simulink is running, then simulink does not get the updated value. It keeps reading the preassigned value. Is there any way by which simulink model can get updated values from MATLAB workspace in real time (without using RT licence or xPC target)
Thanks Mitesh
0 件のコメント
採用された回答
Nirmal Gunaseelan
2011 年 8 月 9 日
One way to tune the parameter based on a change in a variable in the MATLAB workspace is to 'update' the model while it is still simulating (Ctrl+D). What is your use case? Are you controlling the model simulation from another MATLAB script?
10 件のコメント
Fangjun Jiang
2011 年 8 月 9 日
When the model is updated, it is updating the whole model. You need to re-think what you really want. All the approaches talked about above will cause the model to pause, update and then continue. You could leave the simulation continue running while you change the gain of a Gain block, for example. Try that and come back with your true intent.
その他の回答 (4 件)
Andreas Goser
2011 年 8 月 9 日
Many people with this description look for a way that is actually an artificial slowdown of Simulink, so that it is running approximately in sync with real time.
0 件のコメント
Fangjun Jiang
2011 年 8 月 9 日
Use a Constant block in your Simulink model. While your simulation is running, you can double click the Constant block and change its value. The simulation will pause and then continue with the new Constant block value.
0 件のコメント
Dharmendra singh
2012 年 2 月 6 日
One way to tune the parameter based on a change in a variable in the MATLAB workspace is to 'update' the model while it is still simulating (Ctrl+D). What is your use case? Are you controlling the model simulation from another MATLAB script?
satisfiefd with reply but not so much
1 件のコメント
Kaustubha Govind
2012 年 2 月 6 日
Dharmendra: Perhaps you could provide more information on how Nirmal's answer did not help you? The answer is clear and complete as far as I can see.
Tan Phat Nguyen
2018 年 5 月 10 日
Sensor 1 (pressure sensor attached to bottom of tank 1) connects to Pin 0 Arduino Uno Sensor 2 (pressure sensor attached to bottom of tank 2) connects to Pin 2 Arduino Uno When running individually, the Volt value and water level return are correct reality. But when running both Volt = 0, water level = 0. So how do I read at the same time two analog values? Thank you
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Arduino Hardware についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!