Main Content

struct

R2026b

Convert tire data to structure

Since R2023b

    Description

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

    S = struct(obj) converts the tireData object specified by obj to a structure, S. Each tireData object property becomes a field in S, and object information is lost.

    example

    Examples

    collapse all

    Convert a tireData object to a MATLAB® structure. This is useful when passing tire data to functions that accept structures or when saving data to a .mat file without preserving object class information.

    Generate synthetic steady-state tire data.

    td = tireData.generate("Steady-State", ...
        Fz=4000, ...
        alpha=0, ...
        kappa=0, ...
        gamma=0, ...
        Vx=16.7, ...
        IP=220000)
    td = 
      tireData with properties:
    
          CoordinateSystem: "ISO"
                  Filename: [0×0 string]
                  Filepath: [0×0 string]
                        et: [0×1 double]
                     seget: [0×1 double]
                   segment: [1000×1 double]
                  measnumb: [1000×1 double]
                        Fx: [0×1 double]
                        Fy: [0×1 double]
                        Fz: [1000×1 double]

    Convert the tireData object to a structure. Each property becomes a field and object class information is lost.

    S = struct(td);
    fieldnames(S)
    ans = 86×1 cell
    'CoordinateSystem'  
    'Filename'          
    'Filepath'          
    'et'                
    'seget'             
    'segment'           
    'measnumb'          
    'Fx'                
    'Fy'                
    'Fz'                
    

    Input Arguments

    collapse all

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

    Output Arguments

    collapse all

    Converted tire data, returned as a structure or structure array.

    Version History

    Introduced in R2023b