The Output of my scope doesn't change regardless of the initial values in the initialization function under model properties

5 views (last 30 days)
I've been playing around with MATLAB's RF Mixer Example: https://www.mathworks.com/help/simrf/gs/model-an-rf-mixer.html
In the initialization function, I have these values:
modulationAmplitude = 1;
modulationFrequency = 5e5;
LOAmplitude = 1;
LOFrequency = .95e9;
RFCarrier = 1e9;
I have ensured each block is set to the corresponding value. However, no matter what I change those initial values to, the scope output is exactly the same step-by-step. I've tried changing Amplitudes together and seperatly to 4 or higher. I've tried putting the modulationFrequency much higher than the other two and vice versa as well as setting each one to different values individually and yet the scope still looks the same and reaches a max amplitude of 1, even going step-by-step. What am I doing wrong here?

Answers (1)

Chidvi Modala
Chidvi Modala on 31 Mar 2021
This might happen in two scenarios provided below
  • Case 1 :You might be trying to modify the parameters in the existing MATLAB shipped example "ex_simrf_tut_mixer.slx". In the provided MATLAB's RF Mixer Example documentation, defining model variables using initFcn is specified when you create a new model on your own. For the provided existing example "ex_simrf_tut_mixer", variables are not defined using initFcn, instead they are defined in the model workspace. Model workspace variables overrides the variables defined in initFcn callback. So you may need to go to Modeling tab> In design section click the dropdown and select Model Workspace> Edit the model parameters and apply the changes.
  • Case 2: If you are creating a new model on your own and the parameters are still not updating, you might need to update the model using Ctrl+D. For more information on initFcn, you may refer to this documentation

Categories

Find more on View and Analyze Simulation Results in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!