project.m

来自「如果你看过神经模糊与软运算这本书,相信你一定想得到它的源代码.」· M 代码 · 共 54 行

M
54
字号
% Illustration of projection operation% J.-S. Roger Jang, 1993xx = -10:10;yy = -10:10;[x,y] = meshgrid(xx, yy);z = exp(-x.*x/10 - y.*y/30);[m,n] = size(z);subplot(331); mesh(x, y, z);view(-40, 30);xlabel('X'); ylabel('Y'); % zlabel('membership grades');set(gca, 'box', 'on');title('(a) A Two-dimensional MF');proj_x = z;proj_y = z;[maximum, index]=max(z);for i=1:m,	for j=1:n,		if i > index(j),			proj_x(i,j) = maximum(j);		end	endendsubplot(332); mesh(x, y, proj_x);axis('ij');view(-40, 30);xlabel('X'); ylabel('Y'); % zlabel('membership grades');set(gca, 'box', 'on');title('(b) Projection onto X');[maximum, index]=max(z');for i=1:m,	for j=1:n,		if j < index(i),			proj_y(i,j) = maximum(i);		end	endendsubplot(333); mesh(x, y, proj_y);axis('ij');view(-40, 30);xlabel('X'); ylabel('Y'); % zlabel('membership grades');set(gca, 'box', 'on');title('(c) Projection onto Y');% get rid of tick labelsh = findobj(gcf, 'type', 'axes');set(h, 'xticklabels', []);set(h, 'yticklabels', []);

⌨️ 快捷键说明

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