How can i use linkprop in a GUI with multiple axes to link cameraposition

2 views (last 30 days)
If i try the following code in Workspace it works fine:
figure;
ax1 = subplot(2,1,1);
[X1,Y1,Z1] = peaks;
surf(X1,Y1,Z1);
ax2 = subplot(2,1,2);
[X2,Y2,Z2] = peaks(10);
surf(X2,Y2,Z2);
hlink = linkprop([ax1,ax2],{'CameraPosition','CameraUpVector'});
i can rotate both simulateously.
But as soon as i put that text into a GUI Callback button it doesnt syncronize it anymore.
What am i missing?

Answers (1)

Ronen
Ronen on 13 Dec 2015
use setappdata(...) to store your link: setappdata(handleOfParentGui, 'theLink', hlink)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!