Clear Filters
Clear Filters

How to run simulink and m-file simulataneouly?

1 view (last 30 days)
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?

Accepted Answer

Sebastian Castro
Sebastian Castro on 11 Apr 2017
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

More Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!