How to run simulink and m-file simulataneouly?

2 次查看(过去 30 天)
I have been trying to get data from simulink and use it in m-file but since the size of the simulink output is 1000001x1 i am not able to process the data effectively. So,is there a way to prpocess the data from simulink during simulation it self like an online process. What are the procedures or functions to be used?

采纳的回答

Sebastian Castro
Sebastian Castro 2017-4-11
Looks like it would be easier to process the data in Simulink by calling the MATLAB code from the model.
The typical way of doing this is by taking your existing function and calling it in a MATLAB Function block ( See example ).
Note that if your MATLAB file does things that are not supported for code generation, like plotting, user input, certain functions, you will have to either change your code or tell Simulink to run it using the MATLAB interpreter ( See documentation ). This is fine so long as you're staying within MATLAB/Simulink and do not need to generate code from your model.
- Sebastian

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by