Question
How to set tunable struct parameters when simulating from the command line in Rapid Accelerator mode I would like to use a struct as a tunable parameter when running in Rapid Accelerator mode from the command line, in order to run simulations in batch. Is this possible?
Expert Answer
Prashant Kumar
PhD Expert
Answered Aug 10, 2026
Yes. We will assume 'model' is the name of our model that we wish to run, and that this model has an already-defined struct "x" that contains tunable parameters set by fields "a" and "b", e.g.:
x.a = 2 ?x.b = 3
In this case, we can change the parameters and simulate in Rapid Accelerator mode as follows.
Get the current model and parameter structure:
?rtp = Simulink.BlockDiagram.buildRapidAcceleratorTarget(model)
Set new values for the parameters:
x.a = 4 x.b = 7
Modify the parameters in our model object:
parameterSet = Simulink.BlockDiagram.modifyTunableParameters(rtp,'x',x)
?Simulate again:
simout = sim(model,'SimulationMode','rapid', 'RapidAcceleratorUpToDateCheck','off', 'RapidAcceleratorParameterSets',parameterSet)
This is similar to the workflow described in the following documentation, although it does not require parallel computing:
Note that the generated executable resides in the slprj > raccel > model folder, rather than the top-level directory as it does with "RSim." <?p>
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related rapid Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →