Main Content

split

Split single tireData object into array of tireData objects

Since R2024a

    Description

    td=split(obj,criteria) splits a single tireData object specified by obj into an array of tireData objects using criteria specified by criteria.

    example

    Examples

    collapse all

    Use the split function to split a tireData object by each Fz test condition into multiple tireData objects using these input criteria options:

    • Data channel

    • Logical vector

    • Numeric vector

    Import and View Tire Measurement Data

    Import tire measurement data into a tireData object, td.

    td = tireData("example_data.tdx");

    Multiple Fz conditions are included in this data file. Use the plot function to view the normal force versus the elapsed time.

    plot(td,DataVariableNames=["et","Fz"]);

    Figure contains an axes object. The axes object with title Normal force [N] vs Elapsed time [s], xlabel Elapsed time [s], ylabel Normal force [N] contains a line object which displays its values using only markers. This object represents Normal force [N].

    Split tireData Object Using Data Channels

    Specify the normal force Fz as the split criteria. The tireData object is split into four tireData objects at the locations where the nominal normal force value changes.

    tdSplit = split(td,"Fz");

    Plot the resulting tireData objects in tdSplit.

    plot(tdSplit,DataVariableNames=["et","Fz"],ColorBy="Fz");

    Figure contains an axes object. The axes object with title Normal force [N] vs Elapsed time [s], xlabel Elapsed time [s], ylabel Normal force [N] contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent 2140, 4270, 5160, 6460.

    plot(tdSplit,DataVariableNames=["alpha","Fy"],ColorBy="Fz");

    Figure contains an axes object. The axes object with title Lateral force [N] vs Slip angle [rad], xlabel Slip angle [rad], ylabel Lateral force [N] contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent 2140, 4270, 5160, 6460.

    Split tireData Object Using a Logical Vector

    Specify a logical vector indicating true values where changes in the normal force Fz are greater than 500 N as the split criteria. The tireData object is split into four tireData objects at the positions where the value in the logical vector is true.

    tf = [0;diff(td.Fz) > 500];
    tdSplit = split(td,tf);

    Plot the resulting tireData objects in tdSplit.

    plot(tdSplit,DataVariableNames=["alpha","Fy"],ColorBy="Fz");

    Figure contains an axes object. The axes object with title Lateral force [N] vs Slip angle [rad], xlabel Slip angle [rad], ylabel Lateral force [N] contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent 2140, 4270, 5160, 6460.

    Split tireData Object Using Numeric Vector

    Specify an integer array with the index values of the split location. The tireData object is split into four tireData objects.

    idx = find(tf);
    tdSplit = split(td,idx);

    Plot the resulting tireData objects in tdSplit.

    plot(tdSplit,DataVariableNames=["alpha","Fy"],ColorBy="Fz");

    Figure contains an axes object. The axes object with title Lateral force [N] vs Slip angle [rad], xlabel Slip angle [rad], ylabel Lateral force [N] contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent 2140, 4270, 5160, 6460.

    Input Arguments

    collapse all

    The tire data to split, specified as a tireData object.

    Criteria used to split the tireData object, specified as one of these values:

    • Logical vector — true values indicate at which indices to split the tire data object.

    • Integer vector — Integer values indicate at which indices to split the tire data object.

    • String vector — Changes in the segment, data channel, or time indicate where to split the tireData object using one or more of the string values listed in the table.

      ValueDescription
      "segment"

      Splits the tireData object where the segment array has significant changes in values.

      "et"

      Splits the tireData object where the sampling frequency changes.

      "Fz"

      Splits the tireData object where the Fz data channel array has significant changes in values.

      "IP"

      Splits the tireData object where the IP data channel array has significant changes in values.

      "alpha"

      Splits the tireData object where the alpha data channel array has significant changes in values.

      "gamma"

      Splits the tireData object where the gamma data channel array has significant changes in values.

      "kappa"

      Splits the tireData object where the kappa data channel array has significant changes in values.

      "Vx"

      Splits the tireData object where the Vx data channel array has significant changes in values.

      "V"

      Splits the tireData object where the V data channel array has significant changes in values.

    Note

    By default, if criteria are not specified, the split function splits tire data in order of priority:

    1. segment

    2. Data channels (Fz,IP,alpha,gamma,kappa,Vx)

    3. Time (et)

    Data Types: int8 | int16 | int32 | int64 | logical | string

    Output Arguments

    collapse all

    Split tire data, returned as an array of tireData objects.

    Note

    The split function assigns all the non-data channel values to all the output tireData objects.

    Version History

    Introduced in R2024a

    See Also