主要内容

struct

R2026b

Class: tireModel

Create structure from tire model

Since R2023b

Description

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

S = struct(obj) creates a structure, S, with a field for each tire model parameter and tire model value in the tire model specified by obj.

S = struct(obj, GroupFields=true) creates a structure, S, and groups tireModel object fields when you specify the optional name-value argument GroupFields as true.

example

Input Arguments

expand all

Tire model, specified as a tireModel object or an array of tireModel objects.

Option to group tireModel object fields, specified as false or true.

Example: GroupFields=true

Data Types: logical

Output Arguments

expand all

Structure, returned as a structure object or structure array.

Examples

expand all

Convert a tireModel object to a MATLAB structure for programmatic access to parameters. The flat format provides direct field access, while the grouped format organizes parameters by category.

Create a built-in tire model.

tm = tireModel.builtin("Light passenger car 205/60R15","MF62");

Convert the tire model to a flat structure where each parameter is a top-level field.

S = struct(tm);
fieldnames(S)
ans = 260×1 cell
'Name'         
'Description'  
'SourcePath'   
'FZMIN'        
'FZMAX'        
'KPUMIN'       
'KPUMAX'       
'ALPMIN'       
'ALPMAX'       
'CAMMIN'

Convert the tire model to a grouped structure where parameters are organized into nested sub-structures by category.

Sg = struct(tm,GroupFields=true);
fieldnames(Sg)
ans = 38×1 cell
'Name'                
'Description'         
'SourcePath'          
'Manufacturer'        
'TireLine'            
'TireCategory'        
'ConstructionNumber'  
'SerialNumber'        
'TireSize'            
'SectionWidth'        

Each field in the grouped structure contains a sub-structure with the parameters for that category. Access individual parameters using dot notation through the group.

Sg.DIMENSION
ans = struct with fields:
    UNLOADED_RADIUS: 0.3094
              WIDTH: 0.2090
       ASPECT_RATIO: 0.5924
         RIM_RADIUS: 0.1914
          RIM_WIDTH: 0.1501

Version History

Introduced in R2023b

expand all

See Also