How to create an array of structs as input to an Embedded Matlab Function

1 view (last 30 days)
Hello all!
I am currently working on building a guidance-system in Simulink. The problem I'm facing now conserns how to move large amounts of data.
What I want to do is to store for a bunch of Waypoints. Each WP should ideally be a structure with elements like position, type and some metadata. Thus, I need an array of such structures.
The thing is that this shall be rendered by Simulink Coder to run on an embedded system. Thus, I can't use a non-tunable workspace parameter.
The array needs to be able to change.
I've tried using Data Storage-blocks, with the array set as initial condition to the bus. But I can't figure out how to initialise an array of busses in Simulink.
Working with array-of-busses seems a bit of a hassle in Simulink. So, is there another way for the data to be availible in the Matlab Function, but still tunable from the application C-code?
Thanks!
  2 Comments
Ryan G
Ryan G on 6 Jul 2012
How are you creating the array of busses as an input to the EML block? Could you post a screenshot?
The initial question sounds like you want a parameter but the second part sounds like an input so I find it a bit confusing.
Kristian
Kristian on 9 Jul 2012
I havn't found a way to initialize the input as a variable-size array of structs yet, that's where I'm stuck.
I'm not bound on using input, I initially wanted to use a parameter. But as far as I can see, Matlab don't support a tunable array-of-structs parameter.
Thanks!

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!