MATLAB: How to select points using ginput on single mouse click instead of double

ginputmouse click

How do I set my code to use single clicks to register inputs instead of double clicks when using ginput?
Heres my code:
clear
clc
close all
Map=imread('Map.Jpg');
imshow(Map);
hold on;
A = zeros(1, 24);
B = zeros(1, 24);
C = zeros(1, 24);
ActualValues = [124 93; 109 77; 125 83; 117 75; 122 80]
uiwait(msgbox('Choose Point A'));
[x,y] = ginput(1);
hline = plot(x,y,'r+', 'MarkerSize', 50);
A = ginput(1);
uiwait(msgbox('Choose Point B'));
delete(hline);
[x,y] = ginput(1);
plot(x,y,'r+', 'MarkerSize', 50);
B = ginput(1);
disp ('Values:')
disp(A);
disp(B);

Best Answer

Your code already registers single clicks. However, you call ginput() twice between prompts.
Perhaps you just need
A = [x, y];
instead of
A = ginput(1);
Related Question