how can I do an integration window of a signal both in MATLAB and Simulink?
2 views (last 30 days)
Show older comments
Hi all,
I'm developing a Stochastic Knock Control and need to do an integration window of the in-cylinder pressure signal for a window of a 40 crank angle degrees. Any idea?
Also, I need to obtain the maximum amplitude of the signal within that integration window.
Many thanks!
0 Comments
Accepted Answer
Andy L
on 7 Aug 2014
Hi Jorge.
Have you considered running your simulink model from a MATLAB function, using the function sim. You can set up your parameters in your function (make sure to write them in your simulink model too) and using to workspace blocks these will be passed back into the function workspace. You can then use these variables to plot onto a figure, find a max value etc.
I hope this helps.
5 Comments
Andy L
on 8 Aug 2014
Yes - I would look to structure your project in the following way:
- Import the data from Excel into MATLAB - xlsread will help with this.
- Pre process your data using MATLAB to prepare it for your simulink model.
- Run your Simulink Model from MATLAB as mentioned above.
- Post-Process your model outputs that have been passed back into your MATLAB function.
- Any plotting saving etc can be done.
See Also
Categories
Find more on Spectral Measurements 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!