1
votes

I have a, in my opinion, little problem using a Matlab-Function Block in a Simulink Model. I want one of the inputs to be a structure. But that doesn't work so easily, I've come across suggestions on other semi-related problems, which tell about defining Simulink.Bus and so on, but to be honest I don't understand how this can be applied on my problem.

It seems simple:

Structure as input for a Matlab function Block

But I don't know how.

Sorry for the inconvenience.

Regards BZAD

1
In case you didn't find the answer from the links below here's how to do it: let's say you have a bus defined (could be done through the Bus Editor). When editing the Matlab Function block in Matlab's Editor there is a button saying 'Edit Data' in the toolbar. Click on it and you will see a list with all inputs and outputs. Select the input that has to be a structure and specify its data type to match a bus definition. - remus

1 Answers

3
votes

Within Simulink you create a Bus signal using the Bus Creator Block. This can then be fed into a MATLAB Function block, but only if an accompanying Simulink.Bus object is created in the Base Workspace.

See Types of Structures in MATLAB Function Blocks and Create Structures in MATLAB Function Blocks and the links off those pages for more information.