Main Content


Remove property from Simulink.SimulationOutput object



    simOut = removeProperty(simOut,prop) removes one or more properties prop from the Simulink.SimulationOutput object simOut.

    You can use the removeProperty function to remove data logging properties and user-defined properties from a Simulink.SimulationOutput object. You cannot use the removeProperty function to remove read-only properties.


    collapse all

    A Simulink.SimulationOutput object represents the result of a simulation. The SimulationOutput object contains all data logged from simulation and simulation metadata. You can modify the contents of a Simulink.SimulationOutput object by adding or removing information about the simulation.

    Open the model LoggingBlocks, which logs several input signals using multiple logging techniques.


    Use the get_param function to save the values for the Amplitude and Frequency parameters of the Sine Wave block. Store the values in the structure sinConfig.

    sinConfig.sinAmp = get_param("LoggingBlocks/Sine Wave","Amplitude");
    sinConfig.sinFreq = get_param("LoggingBlocks/Sine Wave","Frequency");

    Simulate the model.

    simOut = sim("LoggingBlocks");

    The simulation results contain all logging variables created in simulation. Use the who function to get a list of properties you can modify.

    props = who(simOut)
    props = 5x1 cell
        {'logsout'  }
        {'simout'   }
        {'tout'     }
        {'yout'     }

    For this simulation, suppose you wanted to save only the data for the signal path related to the Sine Wave block. Use the removeProperty function to remove the recordout and yout properties.

    simOut = removeProperty(simOut,["recordout" "yout"]);
    Contents of the Simulink.SimulationOutput object are:
        logsout    simout    tout    

    You can also add data to a Simulink.SimulationOutput object by adding your own properties to the object or by using the setUserData function to specify the value for the UserData property on the Simulink.SimulationMetadata object. Suppose you wanted to save the parameter values for the Sine Wave block as a property on the Simulink.SimulationOutput object. Add the property SineWaveParameters by using a dot the same way you add a field to a structure.

    simOut.SineWaveParameters = sinConfig;
    Contents of the Simulink.SimulationOutput object are:
        SineWaveParameters    logsout    simout    tout    

    Input Arguments

    collapse all

    Simulation results, specified as a Simulink.SimulationOutput object.

    Property to remove, specified as a string, a string array, a character vector, or a cell array of character vectors. To delete a single property, specify the name of the property as a string or a character vector. To delete multiple properties, specify the names of the properties as a string array or a cell array of character vectors.

    You cannot remove read-only properties, such as the SimulationMetadata and ErrorMessage properties, from a Simulink.SimulationOutput object. To get a list of properties that you can remove, use the who function.

    Example: simOut = removeProperty(simOut,"MyProperty")

    Data Types: char | string

    Output Arguments

    collapse all

    Simulation results with property removed, returned as a Simulink.SimulationOutput object.


    • Modifying the contents of simulation results in a Simulink.SimulationOutput object using the post-simulation function can be useful in parallel computing workflows. For example, you can remove data logging properties and send only a subset of logged data from the worker back to the client.

    • You can use the removeElement function to remove logged data from a Simulink.SimulationData.Dataset object.

    Version History

    Introduced in R2019a