MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Guide de l'utilisateur Page 339

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 386
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 338
Building for the Rapid Simulation Target
13-9
<-o> Specifying a New Output Filename for the Simulation
If you have specified Save to Workspace options (that is, checked Time,
States, Outputs,orFinal States checkboxes on the Workspace I/O page of the
Simulation Parameters dialog box under the Simulation menu in Simulink),
the default is to save simulation logging results to the file
modelname.mat. You
can now specify a replacement filename for subsequent simulations. In the case
of the model
rsimtfdemo,bytyping!rsimtfdemo at the MATLAB prompt, a
simulation runs and data is normally saved to
rsimtfdemo.mat.
!rsimtfdemo
created rsimtfdemo.mat
You can specify a new output filename for data logging by typing:
!rsimtfdemo -o sim1.mat
In this case, the set of parameters provided at the time of code generation,
including any From File block data, is run. You can combine a variety of
rsim
flags to provide new data, parameters, and output files to your simulation.
Note that the MAT-file containing data for the From File blocks is required.
This differs from the
grt operation, which inserts MAT-file data directly into
the generated C code that is then compiled and linked as an executable. In
contrast,
rsim allows you to provide new or replacement data sets for each
successive simulation. A MAT-file containing From File or From Workspace
data must be present, however, if any of these blocks (From File or From
Workspace blocks) exist in your model.
<-p> Changing Block Parameters for an rsim Simulation
Once you have altered one or more parameter in the Simulink block diagram,
you can extract the parameter vector,
rtP,fortheentiremodel.ThertP vector,
along with a model checksum, can then be saved to a MATLAB MAT-file. This
MAT-file can be read in directly by the stand-alone
rsim executable allowing
you to replace the entire parameter vector quickly, for running studies of
variations of parameter values.
The model checksum provides a safety check to ensure that any parameter
changes are only applied to
rsim models that have the same model structure.
If any block is deleted, or a new block added, then when generating a new
rtP
vector, the new checksum will no longer match the original checksum. rsim will
detect this incompatibility in parameter vectors and exit to avoid returning
Vue de la page 338
1 2 ... 334 335 336 337 338 339 340 341 342 343 344 ... 385 386

Commentaires sur ces manuels

Pas de commentaire