Is it possible to create an executable for a simscape multibody model?
8 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
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
1 个评论
Stone
2024-10-23
Hi,Why I can not generate a Standalone Desktop App with your method? the exe can plot nothing。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!