Contenido principal

export

Export tire data to external file

Since R2026a

    Description

    Add-On Required: This feature requires the Extended Tire Features for Vehicle Dynamics Blockset add-on.

    export(obj,Filepath) exports tire data from the tireData object specified by obj to the external file specified by Filepath. These file types are supported:

    • Tyre Data Exchange Format (TYDEX) v1.3 files

    • Column-oriented text files

    export(___,Name=Value) specifies additional options when exporting tire data.

    Note

    When exporting tire data to a TYDEX file format, only these name-value arguments are supported. All others are ignored.

    example

    Examples

    collapse all

    Use the export function to export tire data imported from a CSV file to a TYDEX file.

    Import Tire Data

    Define the tire data file to import.

    importFile="ex_tire_data.csv";

    Import the tire data using the tireData.import function.

    td = tireData.import(importFile);

    Define Variable Information

    Specify variables to ignore when exporting the tire data.

    ignoreVariables = ["omega", "phit"];

    Export Tire Data

    Export the tire data. Specify IgnoreVariables as ignoreVariables and specify Precision as 3.

    export(td, ...
        'modifiedTireData.tdx', ...
        Overwrite=true, ...
        IgnoreVariables=ignoreVariables,Precision=3);

    Input Arguments

    collapse all

    Tire data, specified as a tireData object or an array of tireData objects.

    File path to the exported tire data, specified as a string. When exporting an array of tireData objects, the data from each object is written to a separate file. The filenames include the index in parentheses, which is incremented for each file.

    Data Types: char | string

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: tdFile = tireData.export(td, Filepath="/home/user/documents/TireData.tdx", Overwrite=true, Delimiter=";")

    Option to overwrite existing files, specified as false or true.

    Data Types: logical

    Option to include comments, specified as true or false.

    Example: IncludeComments=true

    Data Types: logical

    Symbols designating comments, specified as a character vector, cell array of character vectors, string scalar, or string array.

    Note

    By default, the export function uses the '%' symbol to designate comments on the same line. Specify a cell array of two character vectors, such as {'/*','*/'}, to designate text between those sequences as a comment.

    Example: CommentStyle={'/*','*/'}

    Data Types: char | string

    Option to include headers, specified as true or false.

    Example: IncludeHeaders=false

    Data Types: logical

    Header aliases, specified as a dictionary object. Specify HeaderAlias if you want to rename the header keys from the default tireData object non-data channel property names. Set the tireData non-data channel property name as the dictionary key and the new header name as the value.

    Example: HeaderAlias=dictionary("TireSize","The Tire Size","SectionWidth","The Tire Width")

    Data Types: dictionary

    Tire data file header variable units, specified as a dictionary object. Specify HeaderUnits when you want to change the header variables units from the default tireData property units. The dictionary created must satisfy these requirements:

    • Keys must be defined as the tireData object non-data channel property name.

    • Values must be defined as the units for conversion. Units must be recognized by MATLAB® and convertible from the default units of the tireData properties.

    • Values must be a string.

    Example: HeaderUnits=dictionary("SectionWidth","in","NominalFz","lbf")

    Data Types: dictionary

    Header field delimiter character, specified as a character vector, a cell array of character vectors, or a string. Use any valid character, such as a comma "," or a period ".".

    Note

    By default, the export function uses commas as the delimiter.

    Example: HeaderDelimiter=":"

    Data Types: char | string

    Field delimiter character, specified as a character vector, a cell array of character vectors, or a string. Specify Delimiter using any valid character, such as a comma "," or a period ".".

    Note

    By default, the export function uses commas as the delimiter.

    This table lists common field delimiter characters.

    SpecifierField Delimiter

    ","

    "comma"

    Comma

    " "

    "space"

    Space

    "\t"

    "tab"

    Tab

    ";"

    "semi"

    Semicolon

    "|"

    "bar"

    Vertical bar

    unspecified

    If unspecified, the tireData.export function uses a comma for the delimiter.

    Example: Delimiter=","

    Data Types: char | string

    Variables to export from the tireData object, specified as a row vector of strings or a cell vector of character vectors. KeepVariables must be a data channel, and empty variables are not written to the file.

    Note

    If you specify KeepVariables and IgnoreVariables, the software ignores the IgnoreVariables argument.

    Example: KeepVariables=["Fz","Fx","Fy"]

    Data Types: char | string

    Variables to ignore when export from a tireData object, specified as a row vector of strings or a cell vector of character vectors.

    Note

    If you specify KeepVariables and IgnoreVariables, the software ignores the IgnoreVariables argument.

    Example: IgnoreVariables=["NFx","NFy","NFz"]

    Data Types: char | string

    Tire data variable aliases, specified as a dictionary object. Specify VariableAlias when you want to rename the variables from the default tireData object data channel property names. Set the variable from the tireData object tire data file as the dictionary key and the new name as the value.

    Note

    If you specify both VariableNames and VariableAlias, the software ignores the VariableAlias argument.

    Example: VariableAlias=dictionary("Fx","lonforce","Fy","latforce")

    Data Types: dictionary

    Tire data variable units, specified as a dictionary object. Specify VariableUnits when you want to change the variables units from the default tireData property units. The dictionary created must satisfy these requirements:

    • Keys must be defined as the tireData object data channel property name.

    • Values must be defined as units for conversion. Units specified must be recognized by MATLAB and convertible to from the default units of the tireData properties.

    • Values must be a string.

    Note

    If you specify both VariableUnitsLine and VariableUnits, the software prioritizes the VariableUnits value over the units in the file for any conflicts.

    Example: VariableUnits=dictionary("Fz","lbf","Fy","lbf")

    Data Types: dictionary

    Numeric precision to use in writing data to the file, specified as a scalar, character vector, or C-style format specifier that begins with %, such as '%10.5'. If the value is a scalar, then it indicates the number of significant digits.

    Note

    The Precision argument is only supported for TYDEX files.

    Example: Precision=3

    Example: Precision='%10.5'

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | char

    Locale for writing dates, specified as a character vector or a string scalar of the form xx_YY, where:

    • YY is an uppercase ISO 3166-1 alpha-2 code indicating a country.

    • xx is a lowercase ISO 639-1 two-letter code indicating a language.

    This table lists some common values for the locale.

    LocaleLanguageCountry
    "de_DE"GermanGermany
    "en_GB"EnglishUnited Kingdom
    "en_US"EnglishUnited States
    "es_ES"SpanishSpain
    "fr_FR"FrenchFrance
    "it_IT"ItalianItaly
    "ja_JP"JapaneseJapan
    "ko_KR"KoreanKorea
    "nl_NL"DutchNetherlands
    "zh_CN"Chinese (simplified)China

    Example: Locale="ja_JP"

    Data Types: string

    Date and time data format, specified as a character vector or string scalar that contains letter identifiers. Specify DatetimeFormat when the TestDate header is included in the tire data file. For a complete list of letter identifiers, see the Format property for datetime arrays.

    Example: DatetimeFormat="MM/dd/uuuu"

    Data Types: char | string

    Version History

    Introduced in R2026a