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: