How to implement changing angle of curve as Simulink input?

조회 수: 5 (최근 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 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