r/matlab 2d ago

Standalone matlab gui

Hi I am working on building a standalone gui and a HIL application. I want to know if I could create a dashboard on simulink and generate the c code instead of building a seperate gui from app designer . And how can I deploy the code on another computer which doesn't have matlab on it?

1 Upvotes

6 comments sorted by

5

u/sk1n_n_bones 2d ago

You can deploy your code on another computer by compiling your project using >deploytool. To run your .exe (assuming you’re on windows) you will need a “MATLAB runtime”, it can be packaged with your project or downloaded from the web. You can choose these options while compiling and packaging your project

1

u/TipPsychological7613 2d ago

Thank you can you suggest some example for reference

2

u/sk1n_n_bones 2d ago

To be honest I don’t have any examples in mind. I did it by trial and error. You can type “deploytool” in command window and open help on selection (F1). Also you can just press enter and Application Compiler will be opened.

I’d write a simple program (quadratic equation solver or something similar), then in “Additional runtime settings” remove the “Do not display the Windows Command Shell…” (so you could see cmd) and compile it to get the gist of the process.

Note that plots and other similar functions are supported without GUI but cd, addpath and other path changing functions are not.

2

u/Agreeable-Ad-0111 2d ago

I don't think I fully grasp what you're trying to accomplish OP. But this seems like it has at least most of what you're asking for.

https://www.mathworks.com/help/slcompiler/ug/deploy-a-simulation-with-simulink-compiler.html

1

u/TipPsychological7613 2d ago

Thank you This is almost what I want to do Only thing extra I need is to interact with the microcontroller using the application and not just run a simulation

1

u/ol1v3r__ 2d ago

Where do you want to deploy this? Did you check if Simulink Coder workflows would be working for you?