This app demonstrate how to draw a ROI rectangular interactive to user mouse click, drag and drop within an image when using the Matlab App Designer.
It is adapted from the code found in the link and I accustomed it to the app designer environment.
Lei (2020). Drag and drop in matlab app designer (https://www.mathworks.com/matlabcentral/fileexchange/69195-drag-and-drop-in-matlab-app-designer), MATLAB Central File Exchange. Retrieved .
I am really grateful for your example. However, when I was changing the axis limits I noticed that your functions are updating the position of the object in pixel units, but the position of the object should be updated in axis units. If my axis limits are [0,1] in both directions the slightest move shifts the object out of the axis limits.