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

8 visualizaciones (últimos 30 días)
Amartya Banerjee
Amartya Banerjee el 29 de Mzo. de 2022
Comentada: Stone el 23 de Oct. de 2024
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?

Respuestas (1)

Yash
Yash el 26 de Sept. de 2023
Editada: Yash el 9 de En. de 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 comentario
Stone
Stone el 23 de Oct. de 2024
Hi,Why I can not generate a Standalone Desktop App with your method? the exe can plot nothing。

Iniciar sesión para comentar.

Categorías

Más información sobre Simscape en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by