I'm trying to replicate using Matlab variables for parameters in Simulink blocks, like what was used in the Simulink QPSK example:
I would like to be able to define a variable in Matlab, update it in the Matlab code, and have it update automatically in Simulink (especially with variables that are mathematical expressions). The QPSK example source code seems to show this here (my assumption is that Simulink is grabbing the parameter values from this code):
When I tried to do this myself, I had to manually update the parameters in the Model Explorer in order for it to change in Simulink. I've looked around at a lot of documentation (here, here, here & here for example) and past questions (here), but I'm not seeing the exact answer. It may be a more complicated solution than I anticipated, but I was hoping to keep my Simulink models simple and easy to update. (I'm still learning the intricacies of Simulink and Matlab right now.)
My basic transmitter and Matlab code is shown below for reference. The Matlab file I created (qpsktxinit) is currently located in the model workspace, and is a 1x1 struct with 10 variables.
I appreciate any help/direction you can offer for this issue.