フィルターのクリア

Is it possible to create an executable for a simscape multibody model?

4 ビュー (過去 30 日間)
Amartya Banerjee
Amartya Banerjee 2022 年 3 月 29 日
編集済み: Yash 2024 年 1 月 9 日
I want to create a multibody model with simscape multibody. The end user does not have MATLAB or simulink etc.
I want the user to be able to input his data and then for the multibody model to generate the video of the dynamics and also some graphs based on the input. Is it possible to convert the whole thing into an executable?

回答 (1 件)

Yash
Yash 2023 年 9 月 26 日
編集済み: Yash 2024 年 1 月 9 日
Hi Amartya,
I understand that you want to export the Simulink model such that the end user can access it without having the access to MATLAB and Simulink.
It is possible to create standalone desktop apps from MATLAB and Simulink using the App Designer tool in MATLAB. You can follow the steps mentioned below to achieve this:
1. Create your Simulink model, ensuring that all the required variables are taken from the base workspace.
2. Use the App Designer tool to create an app that takes input for these variables.
You can refer to this link to learn more about the App Designer: https://www.mathworks.com/products/matlab/app-designer.html
3. Link the input and output variables and simulate the model using the app. You can create a button in your app that triggers the simulation when pressed. Inside the callback function, you can use the "assignin" function to assign the input values from the app to the base workspace variables. Then, you can simulate the model and plot the results in the app's UI.
Given below is an example which takes two inputs "a" and "b" from user, assign them to base workspace and outputs the plot within a callback function:
assignin('base', 'a', app.aEditField.Value);
assignin('base', 'b', app.bEditField.Value);
simout = sim('Addition.slx');
plot(app.UIAxes,simout.outWave.Time, simout.outWave.Data)
4. Once your app is working correctly, you can click on the "Share" dropdown in the "Designer" tab of App Designer. Then, select "Standalone Desktop App". Enter the required details and make sure to include the Simulink file in the required files for installation. This will compile your app into an executable (.exe) file that can be shared and run on other machines.
Hope this helps.
Best Regards
Yash

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by