Main Content

simscape.op.targetTable

Generate a table view of operating point data

Since R2025a

Description

opTable = simscape.op.targetTable(op) generates a MATLAB table from the operating point, op. Use this function to programmatically access and inspect Simscape operating point data.

example

Examples

collapse all

This example shows how to generate an operating point table from a model.

Prepare the Model

Load and simulate the VanDerPolOscillatorWithOperatingPoint model.

model = "VanDerPolOscillatorWithOperatingPoint";
open_system(model);
in = Simulink.SimulationInput(model);
mu = 1;
out = sim(in);

Create the operating point using the simlog_VanDerPolOscillatorWithOperatingPoint variable data.

t_steadystate = 30;
op_steadystate = simscape.op.create(out.simlog_VanDerPolOscillatorWithOperatingPoint, t_steadystate);
assignin("base", "op_steadystate", op_steadystate);

Generate the Operating Point Target Table

Use the simscape.op.targetTable function to generate a MATLAB table for the operating point target data.

opTable = simscape.op.targetTable(op_steadystate)
opTable=35×4 table
                 BlockPath                 Variable      TargetValue       Priority
    ___________________________________    ________    ________________    ________

    "1//3*mu"                               "I"        {[0.0845] (A^2)}     "None" 
    "1//3*mu"                               "O"        {[0.0282] (Ohm)}     "None" 
    "Capacitor"                             "i"        {[-0.2904] (A) }     "None" 
    "Capacitor"                             "v"        {[-2.1467] (V) }     "None" 
    "Capacitor"                             "vc"       {[-2.1467] (V) }     "High" 
    "Capacitor"                             "n.v"      {[2.1467] (V)  }     "None" 
    "Capacitor"                             "p.v"      {[0] (V)       }     "None" 
    "Current Sensor"                        "I"        {[-0.2904] (A) }     "None" 
    "Current Sensor"                        "i1"       {[-0.2904] (A) }     "None" 
    "Current Sensor"                        "n.v"      {[2.1467] (V)  }     "None" 
    "Current Sensor"                        "p.v"      {[2.1467] (V)  }     "None" 
    "Current-Controlled Voltage Source"     "i1"       {[0.2904] (A)  }     "None" 
    "Current-Controlled Voltage Source"     "i2"       {[-0.2904] (A) }     "None" 
    "Current-Controlled Voltage Source"     "v1"       {[0] (V)       }     "None" 
    "Current-Controlled Voltage Source"     "v2"       {[0.2904] (V)  }     "None" 
    "Current-Controlled Voltage Source"     "n1.v"     {[0] (V)       }     "None" 
      ⋮

Input Arguments

collapse all

Simscape operating point, specified as a simscape.op.OperatingPoint object.

Output Arguments

collapse all

MATLAB table of operating point target data, returned as a table.

Tips

To export your operating point target table to a spreadsheet, use this script.

sheetName = 'opSpreadSheet.xls';
targetTable = simscape.op.targetTable(op);

exportedTable = targetTable(:, ["BlockPath", "Variable", "Priority"]);
exportedTable(:,"Value") = cellfun(@value, targetTable{:,"TargetValue"}, 'UniformOutput', false);
exportedTable(:,"Unit") = cellfun(@(v) string(unit(v)), targetTable{:,"TargetValue"}, 'UniformOutput', false);
finalTable = exportedTable(:, ["BlockPath", "Variable", "Value", "Unit", "Priority"]);
writetable(finalTable, sheetName);

Version History

Introduced in R2025a