%% Tune Parameters Interactively During Rapid Simulation
% The RSim system target file was designed to let you run batch simulations 
% at the fastest possible speed. Using variable-step or fixed-step solvers 
% with that system target file and a tunable parameter data structure, whether 
% you set *Default parameter behavior* to |Tunable| or to |Inlined|, 
% you can create multiple parameter sets. You can run the data sets with the
% generated executable program (.exe on Windows). Each invocation of the 
% executable program allows specification of the file name to use for results. 
% 
% For this example, *Default parameter behavior* is set to |Inlined|. The model 
% declares workspace variables as tunable parameters. To use the RSim system
% target file with *Default parameter behavior* set to |Tunable|, and without 
% explicitly declaring tunable parameters, see <docid:rtw_ug.mw_4b11232a-7e69-4f70-a54b-e251b63f1b75>.
%% Open Example Model
% Open the example model |rtwdemo_rsim_param_tuning|.
open_system('rtwdemo_rsim_param_tuning');
%%
% This model uses the RSim target and the |rsimgetrtp| 
% function to allow a non real time executable to be passed new data without the need to 
% recompile the Simulink model. This feature allows you to get a map of the tunable 
% parameters declared in a model and save it in a MAT-file. You can then create your own 
% MATLAB GUI or a standalone GUI (independent of MATLAB) to read and write the MAT-file 
% and rerun the executable to produce new output files.
% 
% In the model, double-click the buttons sequentially to run the example. 
%
% To review the code used to create the MATLAB graphical interface and 
% the standalone graphical interface, double-click the *View MATLAB programs* button.
% 
% For more information, see <docid:rtw_ug.f1214>.
%
%%
% Copyright 2019 The MathWorks, Inc.