Hello,
I have a matrix (size 1000×1000) of height values, that I can view with mesh command. From the same figure (that mesh is displayed) I use ginput to the get the coordinates of the mouse and based on the coordinates I can plot the horizontal and vertical line profiles:
[x y] = ginput(1);figure(2)subplot(2, 1, 1)set(gcf, 'Units', 'Inches', 'Position', [5, 5, 10, 3], 'PaperUnits', 'Inches', 'PaperSize', [16, 9.0])plot(Zp(:, round(x(1))), 'b-'); title('Vertical'); grid onsubplot(2, 1, 2);plot(Zp(round(y(1)), :), 'k-'); title('Horizontal');
Now, what I really need is a live line profile plotting, so as I drag the mouse over the mesh figure I can see the two line profiles.
It is like continuously updating the values of x(1) and y(1) and updating figure(2).
Is it even possible? And if so, could anyone guide me with how to do it?
Thanks.
Best Answer