How to use app designer to import a drive cycle and feed into simulink Model ?

3 ビュー (過去 30 日間)
Santhosh Kumar
Santhosh Kumar 2023 年 5 月 9 日
編集済み: Dhruv 2023 年 5 月 18 日
Hi Team,
Wanted help on how to import or select single or multiple drive cycles using matlab app desinger and then feed that into simulink model.

採用された回答

Dhruv
Dhruv 2023 年 5 月 18 日
編集済み: Dhruv 2023 年 5 月 18 日
To import a drive cycle using MATLAB App Designer and feed it into a Simulink model, try following these general steps:
1. Create an App Designer GUI in MATLAB:
• Launch MATLAB and open App Designer by typing “appdesigner” in the MATLAB command window.
• Design your GUI interface by adding necessary components such as buttons, file selection dialog, etc.
2. Add a file selection component:
• Drag and drop a "Button" or "Browse Button" component from the App Designer toolbox onto your GUI.
• Set the appropriate properties for the button, such as the button text and callback function.
3. Implement the file selection callback function:
• Double-click on the button component to open the code editor for its callback function.
• Write MATLAB code to handle the file selection process. You can use the “uigetfile” function to open a file dialog and let the user select the drive cycle file. Refer: Open file selection dialog box - MATLAB uigetfile (mathworks.com)
4. Pass the selected file to Simulink:
• Once the user selects the drive cycle file, you can use the obtained file path to import the drive cycle data in MATLAB.
• In your Simulink model, you can create an input signal block and provide the drive cycle data as the input to your model.
For more detailed information and examples, you can refer to the following documentation:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by