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

📄 movept.m

📁 细胞生长结构可视化工具箱-MATLAB Toolbox1999.zip
💻 M
字号:
% Allow user to move a point by identifying it with the mouse and clicking
% on the new position

function movept(filename)

eval(['load ', filename]);

figure(1);
clf;
%subplot(1,2,1);
plotv2;

cont=1;

while cont == 1
	title('Left click on point to be moved. Right click to end.');
	[X,Y,Button] = ginput(1);
	if Button == 2
		cont = 0;
		break;
	end

	% 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);
	
	title('Click on new location');
	[X,Y,Button] = ginput(1);
	wvis(s,:) = [X,Y];
	if Button == 2
		cont = 0;
	end

	if filename(size(filename,2)) ~= 'a'
		filename = [filename '_a'];
	end

	%subplot(1,2,2);
	clf;
	plotv2;
	title('Move complete');
	
	eval(['save ' filename]);
	%disp(filename);
end

⌨️ 快捷键说明

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