Reputation: 1708
I would like to insert a button in my Simulink file that runs a (.m) function when I double-click on it. How can this be achieved?
Upvotes: 1
Views: 3427
Reputation: 10772
You want to create a block in your model, and use its OpenFcn
callback. There's an example of doing almost exactly this in the Model Callbacks section of the documentation.
The basic steps are:
OpenFcn
callback.Most people would also then put a mask on the subsystem too.
Upvotes: 3