how to store the output of look up table in a variable and use that variable in same simulation

2 views (last 30 days)
i programmed A pwm logic such that it generates pulses comparing constants( in my case many different constants for many switches) and trianglular wave
Now i have a look up table and it generates angles for a given modulation index. Now i want use that angles as constants in pwm logic .
How to store outputs of lookup table in a varables such as a1,a2,a3 and so that i can use that variable by placing in constant blocks

Answers (1)

Yash
Yash on 5 Mar 2024
Hi Kesava,
The following methods can be incorporated to use the generated angles from the lookup table as inputs for the PWM logic:
  • Direct Connection: If you want to use the generated angles from the lookup table as inputs to your PWM logic in the same simulation, you can directly connect the the wire for the output of the lookup table to the input of the PWM blocks. This is the most straightforward method if your simulation allows for it.
  • Data Store Memory Blocks: If it is not possible to connect the outputs and inputs directly, due to some reasons, you can use the Data Store Memory blocks to store the variables. You can then utilise Data Store Read and Data Store Write blocks to access and update the variables. Given below is the documentation link for the Data Store Memory blocks: https://www.mathworks.com/help/simulink/slref/datastorememory.html.
  • To Workspace and From Workspace Blocks: It is also possible to use "To Workspace" and "From Workspace" blocks to write to the base workspace and read from it. The documentations are as follows: To Workspace (https://www.mathworks.com/help/simulink/slref/toworkspace.html), From Workspace (https://www.mathworks.com/help/simulink/slref/fromworkspace.html)
Hope this helps!

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!