Here is the reference for connection to arduino with MATLAB.
You can try first setting up a connection with MATLAB itself perform some operations.
When you feel comfortable you start with making utility functions like
- Connect To Arduino (Make some field for port and stuff)
- Read value write value
- Other function for your use case
Add these function as callback in your AppDesigner, like ButtonPushedFcn