Home How to use SimulationInput object as property of a handle class
 There seems to be a bug when using the "new" (since R2009b) sim command in conjuction with handle classes. I am trying to migrate my obsolete code using simset to the new version. Consider this simple class: classdef SimulationClass < handle %SimulationClass Simulate process using model properties modelFilename char simInp simulationTime double end methods function obj = SimulationClass(simulationTime) obj.simulationTime = simulationTime; end function prepareSimulation(obj, modelFilename) obj.modelFilename = modelFilename; obj.simInp = Simulink.SimulationInput(obj.modelFilename); obj.simInp.setModelParameter('Solver', 'ode15s',... 'OutputOption', 'RefineOutputTimes'); end function runSimulation(obj) simulationResults = sim(obj.simInp); end end end  Again, I run mySim = SimulationClass(1:10); mySim.prepareSimulation('mySimulinkSheet');  But the resulting mySim.simInp object is empty, except for the ModelName. Also, this does not work either: mySim.simInp.setModelParameter('Solver', 'ode15s','OutputOption', 'RefineOutputTimes');  Can anyone confirm this, please? Is this a similar bug as the one in the linked question? Is there a workaround?