www.pudn.com > LPCToolbox.rar > RCFIG_CLICK.M
function rcfig_click global Ap Cs Handle RFDvars % this is a windowbtnup callback on Handle.rcfig %--- get the click location curaxis = get(Handle.rcfig, 'CurrentAxes'); point = get(curaxis, 'CurrentPoint'); point = round(point(1,1:2)); % x,y values estOrder = point(1); %--- redraw the line set(RFDvars.vertline, 'xdata', [estOrder estOrder]); RFDvars.estOrder = estOrder; %--- update the running mean Cs.rm_ncoeffs = (Cs.rm_ncoeffs*Cs.rm_count + estOrder) / (Cs.rm_count+1); Cs.rm_count = Cs.rm_count + 1; %--- any click is a select+accept click % clicktype = get(Handle.rcfig, 'SelectionType'); % clicktype: normal (left), extend (middle), alt (right) if (Cs.ncoeffs ~= RFDvars.estOrder) | ~ishandle(Handle.pksfig) Cs.ncoeffs = RFDvars.estOrder; set(get(gca,'title'), 'string', getstatusstr); analyzeSnd; pksfig_draw; else % no need to reanalyze the sound. just show the figure window. figure(Handle.pksfig); end return;