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

조회 수: 1 (최근 30일)
Kristian
Kristian 2012년 7월 4일
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
Ryan G
Ryan G 2012년 7월 6일
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 2012년 7월 9일
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!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Array and Matrix Mathematics에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by