How to implement changing angle of curve as Simulink input?

4 ビュー (過去 30 日間)
Johannes Wieser
Johannes Wieser 2021 年 10 月 14 日
回答済み: Pavan Guntha 2021 年 11 月 18 日
Dear MatLab community,
first off, I just started off using MatLab and Simulink, so my knowledge is very much limited. :)
I'm trying to model skiing turns using a combination of MatLab and simulink.
So far I've modeled the velocity profile when skiing down a steep slope without turns.
I also created a model to incorporate the directionchanges when doing curves.
So far so good, but I've run into a problem:
1.) How do I feed simulink my direction as a angle between the the curve and the main plain?
I've used a for-loop to get the angle of each directional vector n and wrote that into a 61x1 Matrix.
Constant doesn't work because it's always changing obviously.
I tried to convert the vector into a signal, but I'm not really sure how to do that in my case.
What is the best way to get that data into my simulink model?
The Black Arrows are my directional Vectors.
Best Regards
Johannes

回答 (1 件)

Pavan Guntha
Pavan Guntha 2021 年 11 月 18 日
Hi Johannes,
You could store the angles of each directional vector into a workspace variable and then leverage From Workspace block in Simulink to load the data into Simulink. You could mention the sample time as well in the block properties so that Simulink can sample the data from the variable w.r.t the sample time mentioned. You could also look at the following example to understand the workflow: Load Data Using the From Workspace Block
Hope this helps!

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by