⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 identpt.m

📁 细胞生长结构可视化工具箱-MATLAB Toolbox1999.zip
💻 M
字号:
% Allow user to identify a point by clicking it with the mouse
% Gives Visual coordinates and actual coordinates

function identpt(filename)

eval(['load ', filename]);

figure(1);
clf;
plotv2;

cont=1;
title('Left click on point to be identified. Right click to end.');
while cont == 1
	

	[X,Y,Button] = ginput(1);
	if Button == 2
		cont = 0;
		break;
	end
	figure(1);
	clf;
	plotv2;

	% Compute distances to nodes from pt
	dis=zeros(size(wvis,1),1);
	for i=1:size(wvis,1)
		dis(i) = norm([X,Y]-wvis(i,:));
	end
	[minval,s] = min(dis);
	
	visc = [ num2str(wvis(s,1)) ', ' num2str(wvis(s,2))];

	actc=[];	% Actual coordinates
	for i=1:n
		actc = [actc, num2str(w(s,i)), ', '];
	end

	title(actc);
	text(wvis(s,1),wvis(s,2),visc,'Color','red');
	drawnow;
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -