what does this do % Si absence de changement de rapport, lancement du modèle b try…
- User
what does this do % Si absence de changement de rapport, lancement du modèle b try sim('MDL_Brio_DCT_b.mdl',[tbegin tend],simset('SrcWorkspace','current')) catch tend=15; sim('MDL_Brio_DCT_b.mdl',[tbegin tend],simset('SrcWorkspace','current')) end
- Assistant
The provided code is a MATLAB script that utilizes the Simulink environment to simulate a model. Let's break down what each part does:
-
% Si absence de changement de rapport, lancement du modèle b: This is a comment written in French, meaning "If there is no change in gear, start model b." It suggests the context or intention behind the subsequent code.
-
try: This begins a
try-catchblock, which is used for error handling. The code inside thetryblock is executed, and if an error occurs, the execution jumps to thecatchblock.
-
- User
for this sim('MDL_Brio_DCT_b.mdl',[tbegin tend],simset('SrcWorkspace','current')) I got at one point Unreconized function or variable simset
- Assistant
The error message "Unrecognized function or variable 'simset'" indicates that MATLAB is unable to find the
simsetfunction, which is supposed to create a simulation options set with specific settings to be passed to thesimfunction. Here are a few reasons why this might occur and potential solutions:-
MATLAB Version: Ensure you are using a version of MATLAB that still supports the
simsetfunction. If you're using a very recent version, it's possible thatsimsetis deprecated or removed. -
Path Issues: Make sure your MATLAB path is correctly set up and hasn't been altered in a way that prevents the function from being recognized. You can reset the MATLAB path to default using the
restoredefaultpathcommand. -
Alternative Approach: MATLAB has been transitioning to using name-value pair arguments directly in the function, making less necessary. If isn't recognized, you can modify the call to:
-