Search code examples
matlabsimulinktelecommunicationsoftware-defined-radio

how to edit simulink plutosdr qpsk example


I am working with this example from MathWorks: https://www.mathworks.com/help/supportpkg/plutoradio/examples/qpsk-transmitter-with-adalm-pluto-radio-1.html

When i run the example it creates an sdrqpsktx variable in the matlab workspace

I want to change sdrqpsktx.MessageBits to something smaller.

When i run the following code in matlab:

a = sdrqpsktx.MessageBits(1:448);
sdrqpsktx.MessageBits = a;

I successfully change sdrqpsktx.MessageBits to a.

However when i run this in simulink sdrqpsktx.MessageBits changes back to its original size.

How do i permanently change sdrqpsktx.MessageBits and run the example with my changes?

Thank you.


Solution

  • There is a model callback, probably a StartFcn, that is overwriting your changes to the variable every time you start the simulation. You either need to delete or modify that code.

    To see the code go to: File->Model Properties->Model Properties, and select the Callback tab.

    Any callback that is followed by a * has code in it. Click on that callback to see the code.

    See Callbacks for Customized Models for more detailed information.