You are on page 1of 3

n=15;

step=8/(n-1); %step
x=-4:step:4;
y=-4:step:4;
z=zeros(n,n);
for i=1:n
for j=1:n
z(i,j)=x(i).^2-y(j).^2;
if z(i,j)>4
z(i,j)=4;
elseif z(i,j)<-4
z(i,j)=-4;
end
end
end
figure(2)
surf(x,y,z)
xlabel('x')
ylabel('y')
zlabel('z')
title('Target')

>> fuzzy

You might also like