View and Modify Operating Point Object (MATLAB Code)
This example shows how to view and modify the states in a Simulink model using an operating point object.
Create an operating point object from the Simulink Model.
sys = 'watertank'; load_system(sys) op = operpoint(sys)
Operating point for the Model watertank. (Time-Varying Components Evaluated at time t=0) States: ---------- (1.) watertank/PID Controller/Integrator x: 0 (2.) watertank/Water-Tank System/H x: 1 Inputs: None ----------
The operating point, op, contains the states and input levels of the model.
Set the value of the first state.
op.States(1).x = 1.26;
View the operating point state values.
(1.) watertank/PID Controller/Integrator x: 1.26 (2.) watertank/Water-Tank System/H x: 1
If you modify your Simulink model after creating an operating point object, then use update to update your operating point.