Hi,
I want to use a SimulationInput object as an argument for "sim()" because it seems to work with simulink compiler.
The error
Error using SimulationClass/runSimulation (line 63)
Brace indexing is not supported for variables of this type.
Error in testclass (line 3)
myobj.runSimulation(); - Show complete stack trace
ocurrs when the method runSimulation is run.
I can't figure out exactly why this is happening. It does run fine when I use the modelname, that is a string: sim(modelName).
The "sim" command isn't shadowed. I get an error when I use it without any arguments as well.
Maybe something is wrong with my SimulationInput object. I added the output of SimIn.
myobj = SimulationClass('Bremsscheibensimulation_Simulation', "AMS-TEST", "input_script");
function runSimulation(obj)
simIn = Simulink.SimulationInput(obj.simModelName);
simIn = simIn.loadVariablesFromMATFile(obj.simDataFile);
simIn = simIn.setModelParameter('StopTime', num2str(obj.fahrmanoeverObj.t_sim));
simIn = simulink.compiler.configureForDeployment(simIn);
obj.simOutput = sim(simIn);
SimulationInput with properties:
ModelName: 'Bremsscheibensimulation_Simulation'
InitialState: [0×0 Simulink.op.ModelOperatingPoint]
ModelParameters: [1×3 Simulink.Simulation.ModelParameter]
BlockParameters: [0×0 Simulink.Simulation.BlockParameter]
Variables: [1×120 Simulink.Simulation.Variable]