How to implement changing angle of curve as Simulink input?

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by