Is it possible to create an executable for a simscape multibody model?
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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?
0 Commenti
Risposte (1)
Yash
il 26 Set 2023
Modificato: Yash
il 9 Gen 2024
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
1 Commento
Stone
il 23 Ott 2024
Hi,Why I can not generate a Standalone Desktop App with your method? the exe can plot nothing。
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!