The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Running Simulink model from m.files
Replies: 2   Last Post: May 22, 2000 6:35 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Hire PC

Posts: 2
Registered: 12/11/04
Running Simulink model from m.files
Posted: May 20, 2000 9:57 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi everyone,

Can somebody tell me what i am doing wrong? I have written an m.file
that is supposed to run batches of simulink model simulations, adjusting
varia. In the m-file, i have set the model parameters such that the
final values of the state variables are saved as 'xFinal' at the end of
each simulation (the m-file is supposed to execute 80). The m-file also
assigns a unique name to the 'xFinal' at the end of each simulation, and
the 80 xFinal vectors are called up by their identifiers and saved as a
single matrix at the end of the script.

I am running into problems with the 'xFinal' variable name. When i
attempt to call up 'xFinal' after simulating the model, Matlab
consistently refuses to recognise that i commanded it to save the final
values as ''xFinal'. Only if I manually (ie in the Simlink GUI) run the
simulation (with 'xFinal' entered in the Simulation Parameters dialog
box), will xFinal show up in the Matlab workspace. If i then invoke the
m-file, it marches through all 80 simulations, spitting out identical
values for xFinal - the original values from running it manually!!
Matlab seems incapable of recognising the FinalStateName comand that i
use to assign a name to the final value vector.

Has anyone had this problem? Help!

Here is a copy of what I have in the m-file for the first 2 iterations:

options = simset('FinalStateName','xFinal')
a1=xFinal([2 3])

options = simset('FinalStateName','xFinal')
a2=xFinal([2 3])

Many thanks for any help you can offer.

Paul R.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.