Reputation: 23
We have developed a set of matlab functions that have been tested (basically event detectors whose inputs are bio signals, thus time series).
We now want to do Simulink simulation using« these m files whose input will be the mentioned bio-signals time series.
What would be the simplest way to do this , having in mind that each mentioned m file has about 2000 code lines and has a certain degree of complexity (wavelets etc).
Many thanks in advance
Upvotes: 0
Views: 64
Reputation: 10762
You've got two issues
How to deal with inputting the time series
For this you most likely want to use a From Workspace block to read the data from the MATLAB Workspace. But exactly how to do this will depend on exactly what's in your time series.
How to incorporate the m-files
This will depend a little on what the inputs and outputs from your function are. Assuming they are numeric then the easiest, and most likely the best way to do this, is to use MATLAB Function blocks and inside those blocks just make function calls to your existing functions. That is, the blocks are just wrappers into your existing code. I would recommend doing this rather than copying the code into the blocks as it means your Simulink model is using exactly the same code as you are currently using (and if you make any changes to the code you don't need to remember to do it in two places.
If the inputs and outputs aren't numeric then you can forget about using Simulink.
Of course, doing both of the above leads to the question of why you are interested in using Simulink as it's just going to be a wrapper around your existing code.
Upvotes: 1