feeding structures into simulink busses
Mostrar comentarios más antiguos
Hi all;
I am new to simulink so please bear with me. I am attempting to convert parts of a matlab model (consisting hundreds of functions spread throughout tens of thousands of lines) into simulink such that these form stand alone models isolated from a test environment and will eventually go onto a real time processor.
Part of this activity is calling the simulink model from the matlab script and executing only a single time step feeding it a large number of structures and singular inputs. The same structures are then output from the model with a large number of ammendemnts to the variables stored within. This will then affect the inputs for when the simulink model is called again by the matlab model (so I cant have a set of time-stepped variables).
I am trying to call the model from the script in such a way that I can declare the inputs against the strctures which will then feed the data into the busses and carry out the simulink model and output it back into the structures.
In total I have 21 inputs and 13 ouputs all of which are a mix of structures and single values. I have tested the simulink sections one part at a time and all input and output successfully when I am driving them with single values from workspace. However now I have integrated it all into a single suite I am trying to drive it from the whole matlab model and it doesnt work.
I am trying to call the sim command thusly:
[Struct1,Struct2,Var3]=sim('MyModel.mdl',Struct1,Struct2,Var3,Input4);
I know this probably isnt the way it is supposed to be done but I cannot find any suggestion of another way to do it. Unfortunately the inputs dont exist in the workspace as they are dynamically passed from function to function until they arrive at the point where I need to call the simulink.
Help would be massively appreciated
Regards
Amardeep
1 comentario
Amardeep
el 24 de Oct. de 2011
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programmatic Model Editing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!