How to use a simulink block in m-file

I would like to transmit an image after slicing it by passing through an turbo encoder through an awgn channel.
I don't know how to use an turbo encoder block in my m-file. I want to pass parameters to this block and get results from the block so that i can pass this result to the awgn channel.

 Accepted Answer

TAB
TAB on 3 Apr 2012
There is no way of using simulink block in the m-file. What you can do is
  1. Create the model with the simulink block.
  2. Pass the inputs or parameters to the model from your m-file (through base workspace or mat-file).
  3. Run the model from your m-file and save the model output to base workspace or mat-file.
  4. Use the model output inside your m-file.
Also if you want, you can access model output at run time (when model is running) using RunTime object or Event listener.

More Answers (0)

Categories

Find more on Modeling 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!