values

Class: simscape.logging.Series
Package: simscape.logging

Extract values vector from simulation series

Syntax

va = path_to_var.series.values
va = path_to_var.series.values('unit')

Description

va = path_to_var.series.values returns a row vector of variable values contained in the series, in default units. path_to_var is a full identifier path to the variable node associated with the series.

va = path_to_var.series.values('unit') returns a row vector of variable values in the specified units. unit must be commensurate with the default units of the variable.

For nonscalar variables of size m-by-n, this method returns a row vector of m*n*steps size, where steps is the number of steps in the series, and each m*n block represents the logged value for the variable in a column major form. For example, if a variable size is 2-by-2, then the first four elements in the row vector are the a11, a21, a12, and a22 elements at the first time step.

Examples

Return the deformation values of a Translational Spring block, located at the top level of the model diagram:

v1 = simlog.Translational_Spring.x.series.values

v1 =

  1.0e-003 *

         0
    0.0000
    0.0000
    0.0001
    0.0002
    0.0004
    0.0007
    0.0012
    0.0018
    0.0025
    0.0034
    0.0044
    0.0056
    0.0070
    0.0085
    0.0101
    0.0119
    0.0139
    0.0160
    0.0183
    0.0207
    0.0233
    0.0260
    0.0289
    0.0319
    0.0351
    0.0384
    0.0419
    0.0455
    0.0492
    0.0531
    0.0572
    0.0614
    0.0657
    0.0702
    0.0748
    0.0796
    0.0845
    0.0895
    0.0947
    0.1000
    0.1055
    0.1111
    0.1168
    0.1227
    0.1287
    0.1348
    0.1411
    0.1475
    0.1540
    0.1607
    0.1675
    0.1710

The previous command returns the deformation values in meters (the default unit of the series). To return the same deformation values in different units, for example, in inches, type:

v1 = simlog.Translational_Spring.x.series.values('in')

v1 =

         0
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    0.0001
    0.0001
    0.0001
    0.0002
    0.0002
    0.0003
    0.0003
    0.0004
    0.0005
    0.0005
    0.0006
    0.0007
    0.0008
    0.0009
    0.0010
    0.0011
    0.0013
    0.0014
    0.0015
    0.0016
    0.0018
    0.0019
    0.0021
    0.0023
    0.0024
    0.0026
    0.0028
    0.0029
    0.0031
    0.0033
    0.0035
    0.0037
    0.0039
    0.0042
    0.0044
    0.0046
    0.0048
    0.0051
    0.0053
    0.0056
    0.0058
    0.0061
    0.0063
    0.0066
    0.0067