| Machine | sf_car |
| Charts | shift_logic |
| Created By | Unknown |
| Version | none |
| Data | Tconfirm |
| Target | sfun |
| Machine | sf_car |
| Description | Default S-Function target. |
| Code Command | sfc |
| Code Flags | -sfun-debug-consistency-range-conflict |
| Make Command | mex -v |
| Chart | shift_logic |
| Machine | sf_car |

| Data | down_threshold , tdn , tup , up_threshold , throttle , vehicle_speed , gear , Tconfirm |
| Events | DOWNSHIFT21 , DOWNSHIFT32 , DOWNSHIFT43 , UPSHIFT12 , UPSHIFT23 , UPSHIFT34 |
| States | gear_selection |
| State | gear_selection |
| Parent | shift_logic |
| Label | gear_selection/ |

| Substates | gear_state , selection_state |
| State | gear_state |
| Parent | gear_selection |
| Label | gear_state |

| Substates | fourth , second , third , first |
| Transition | T1 |
| Parent | gear_state |
| Label | UPSHIFT34 |

| Source | third |
| Dest | fourth |
| Chart | shift_logic |
| Transition | T2 |
| Parent | gear_state |
| Label | UPSHIFT23 |

| Source | second |
| Dest | third |
| Chart | shift_logic |
| Transition | T3 |
| Parent | gear_state |
| Label | UPSHIFT12 |

| Source | first |
| Dest | second |
| Chart | shift_logic |
| Transition | T5 |
| Parent | gear_state |
| Label | DOWNSHIFT43 |

| Source | fourth |
| Dest | third |
| Chart | shift_logic |
| Transition | T6 |
| Parent | gear_state |
| Label | DOWNSHIFT32 |

| Source | third |
| Dest | second |
| Chart | shift_logic |
| Transition | T7 |
| Parent | gear_state |
| Label | DOWNSHIFT21 |

| Source | second |
| Dest | first |
| Chart | shift_logic |
| State | selection_state |
| Parent | gear_selection |
| Label | selection_state/ during: down_threshold = ml('interp2([1:4],downth, downtab, %g, %g)', gear, throttle);... up_threshold = ml('interp2([1:4],upth, uptab, %g, %g)', gear, throttle); |

| Substates | upshift_confirm , steady_state , downshift_confirm |
| Transition | T9 |
| Parent | selection_state |
| Label | [vehicle_speed > up_threshold] |

| Source | steady_state |
| Dest | upshift_confirm |
| Chart | shift_logic |
| Transition | T10 |
| Parent | selection_state |
| Label | [vehicle_speed < down_threshold] |

| Source | steady_state |
| Dest | downshift_confirm |
| Chart | shift_logic |
| Transition | T11 |
| Parent | selection_state |
| Label | [vehicle_speed < up_threshold] |

| Source | upshift_confirm |
| Dest | steady_state |
| Chart | shift_logic |
| Transition | T12 |
| Parent | selection_state |
| Label | [vehicle_speed > down_threshold] |

| Source | downshift_confirm |
| Dest | steady_state |
| Chart | shift_logic |
| Transition | T13 |
| Parent | selection_state |
| Label | [t - tup >= Tconfirm & ... vehicle_speed >= up_threshold] |

| Source | upshift_confirm |
| Dest | J3 |
| Chart | shift_logic |
| Transition | T16 |
| Parent | selection_state |
| Label | [t - tdn >= Tconfirm & ... vehicle_speed <= down_threshold] |

| Source | downshift_confirm |
| Dest | J4 |
| Chart | shift_logic |
| Transition | T17 |
| Parent | selection_state |
| Label | [gear == 3]/UPSHIFT34 |

| Source | J3 |
| Dest | J2 |
| Chart | shift_logic |
| Transition | T18 |
| Parent | selection_state |
| Label | [gear ==4]/DOWNSHIFT43 |

| Source | J4 |
| Dest | J1 |
| Chart | shift_logic |
| Transition | T19 |
| Parent | selection_state |
| Label | [gear == 2]/UPSHIFT23 |

| Source | J3 |
| Dest | J2 |
| Chart | shift_logic |
| Transition | T20 |
| Parent | selection_state |
| Label | [gear == 3]/DOWNSHIFT32 |

| Source | J4 |
| Dest | J1 |
| Chart | shift_logic |
| Transition | T21 |
| Parent | selection_state |
| Label | [gear == 2]/DOWNSHIFT21 |

| Source | J4 |
| Dest | J1 |
| Chart | shift_logic |
| Transition | T22 |
| Parent | selection_state |
| Label | [gear == 1]/UPSHIFT12 |

| Source | J3 |
| Dest | J2 |
| Chart | shift_logic |
| Event | DOWNSHIFT21 |
| Parent | shift_logic |
| Scope | LOCAL |
| Trigger | EITHER_EDGE |
| Event | DOWNSHIFT32 |
| Parent | shift_logic |
| Scope | LOCAL |
| Trigger | EITHER_EDGE |
| Event | DOWNSHIFT43 |
| Parent | shift_logic |
| Scope | LOCAL |
| Trigger | EITHER_EDGE |
| Event | UPSHIFT12 |
| Parent | shift_logic |
| Scope | LOCAL |
| Trigger | EITHER_EDGE |
| Event | UPSHIFT23 |
| Parent | shift_logic |
| Scope | LOCAL |
| Trigger | EITHER_EDGE |
| Event | UPSHIFT34 |
| Parent | shift_logic |
| Scope | LOCAL |
| Trigger | EITHER_EDGE |
| Data | Tconfirm |
| Parent | sf_car |
| Scope | WORKSPACE |
| Data Type | double |
| Data | Tconfirm |
| Parent | shift_logic |
| Scope | WORKSPACE |
| Data Type | double |
| Data | down_threshold |
| Parent | shift_logic |
| Scope | LOCAL |
| Data Type | double |
| Data | gear |
| Parent | shift_logic |
| Scope | OUTPUT |
| Data Type | double |
| Units | int |
| Range | 1...4 |
| Data | tdn |
| Parent | shift_logic |
| Scope | LOCAL |
| Data Type | double |
| Data | throttle |
| Parent | shift_logic |
| Scope | INPUT |
| Data Type | double |
| Units | double |
| Data | tup |
| Parent | shift_logic |
| Scope | LOCAL |
| Data Type | double |
| Data | up_threshold |
| Parent | shift_logic |
| Scope | LOCAL |
| Data Type | double |
| Data | vehicle_speed |
| Parent | shift_logic |
| Scope | INPUT |
| Data Type | double |
| Units | double |