How can I link and run a script to work with a simulink model?

5 views (last 30 days)
Hello.
I am currently studying Power Inverters, with the aim of building a 27 level inverter.
I successfully simulated the simple inverters using bipolar and unipolar PWM modulations. For these simulations I used sine and triangular waveforms and logic elements to generate the switching of IGBTs.
Now I want to make a program that will generate the pulses, think about as if you were substituting the sine, triangular and logic elements, for a microcontroller (that's how I will implement it in real life).
I am thinking on programing a script that will generate S1 S2 S3 and S4 vectors, however I still don't know how to link the script with the simulation, timing and everything.
Any help would be apreciated, thank you.
  1 Comment
Aquatris
Aquatris on 29 Oct 2018
There are block in simulink that get data from workspace. Depending on the signals you have you can either use "from workspace" or "repeating sequence" blocks.

Sign in to comment.

Answers (1)

Sabin
Sabin on 29 Sep 2023
Use a MATLAB Function block in Simulink if you want to use MATLAB code in simulation:

Community Treasure Hunt

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

Start Hunting!