Using data struct in Simulink Embedded Matlab function

I have the following goal:
Path following of a car by feedback control. The path waypoints are generated in Matlab. I would like to use Simulink to simulate the cars behavior under different feedback control strategies.
As the car moves along the path the setpoint for the feedback control requires knoledge of the coordinates of the "next" waypoint.
So my question:
1. How do I make a struct containing waypoint data (sitting in my workspace) available from within the Embedded MATLAB function?
2. Can I change given struct from within the Embedded MATLAB function (e.g. mark which waypoints already passed to know which one the "next" waypoint is)
3. Is this something I should/could do with stateflow?
Thanks in advance for any useful answers.
J

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 5월 5일

1 개 추천

You can work with structures in an (Embedded) MATLAB Function block using buses. See Working with Structures and Bus Signals.

댓글 수: 2

Hi..I have system in simulink,in my system I control and optimize my pıd parameter ki,kp,kd with particle swarm optimization..I have pso matlab .mfile for pıd controller..I want to use pso .mfile for optimize my pıd in simulink.But I dont know How it work..Do I use embedded function sımulınk block? and How I use embedded simulink block..I make an very simple example embedded sımulınk block and it gives error.Could you help me?
Halit: Your question is unrelated to this posting. Please create a new question.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Stateflow에 대해 자세히 알아보기

질문:

2011년 5월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by