clc; clear; close all;
figure; axis([0 1 0 1]); hold on; grid on;
i = 0;
while i < 10
i = i + 1;
k = waitforbuttonpress;
point_temp = get(gca, 'currentpoint');
plot(point_temp(1, 1), point_temp(1, 2), 'p', 'MarkerSize', 15, 'MarkerEdgeColor', 'r', 'MarkerFaceColor', 'g');
figure; axis([0 1 0 1]); hold on; grid on;
i = 0;
while i < 10
i = i + 1;
k = waitforbuttonpress;
point_temp = get(gca, 'currentpoint');
plot(point_temp(1, 1), point_temp(1, 2), 'p', 'MarkerSize', 15, 'MarkerEdgeColor', 'r', 'MarkerFaceColor', 'g');
end
来源:matlab论坛