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

📄 pf_plot.m

📁 % % set some variables in the workspace to control behaviour: % % graphicsMode 0 no graphics, %
💻 M
字号:
function h = pf_plot(pf, flag)

	% plot the particles

	z = [pf.x.s]';

	if nargin == 1,
		flag = 0;
	end

	exists = findobj('Name', pf.name);
	usefig(pf.name);


	if isempty(exists) & ~isempty(pf.gpos),
		% window doesnt exist, and gpos is specified
		disp('** Window being created');
		set(gcf, 'Units', 'normalized');
		set(gcf, 'Position', pf.gpos);
	end

	if flag == 0,
		clf
		h1 = axes;
		plot(z(:,1), z(:,2), '.')
		axis([pf.xmin pf.xmax pf.ymin pf.ymax]);
		grid
	else
		cm = 0.3;
		wm = 0.65
		marg = 0.04;

		clf
		h1 = axes
		set(gca, 'Position', [cm cm wm wm])

		plot(z(:,1), z(:,2), '.')
		axis([pf.xmin pf.xmax pf.ymin pf.ymax]);
		grid on
		hold on
		plot(mean(z(:,1)), mean(z(:,2)), 'go');
		set(gca, 'XTickLabel', [])
		set(gca, 'YTickLabel', [])

		set(gcf,'nextplot', 'add') 
		h2 = axes
		set(gca, 'Position', [cm marg wm cm-marg])
		plot(z(:,1), [x.pi]', '.');
		set(h2, 'Xlim', [pf.xmin pf.xmax]);
		grid

		h3 = axes
		set(gca, 'Position', [marg cm cm-marg wm])

		plot([x.pi]', z(:,2), '.');
		set(h3, 'Ylim', [pf.ymin pf.ymax]);
		grid
	end

	drawnow

	% return the handle to main window
	if nargout > 0,
		h = h1;
	end

⌨️ 快捷键说明

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