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
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 个评论
Halit
2012-3-15
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?
Kaustubha Govind
2012-3-15
Halit: Your question is unrelated to this posting. Please create a new question.
类别
在 帮助中心 和 File Exchange 中查找有关 Stateflow 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!