There is a problem in the Matlab slider related to the callback only on MouseUp and not on MouseMove, so a pure matlab implementation will always be strange.
The best way is to switch to Java in Matlab. This way you don't have to re-execute the whole scroll logic. You can put the Java Swing GUI component inside the Matlab window, this is not at all complicated.
In particular, you should use the Swing JScrollPane Class. Using the Matlab javacomponent() function, you can put it in the Matlab window.
There are several examples on the Internet of how to get an image in the scroll pane, just check out the JScrollPane image . You can use Java classes inside matlab with the usual Matlab syntax (no new , ecc. Key needed)
Mikhail
source share