Embed presentation
Download to read offline
![%artificial intellegent
%COLD
function y = cold(x);
[m n]=suhu(x);
for i=1:n,
if x(i) >=35
y(i) = 0;
else if x(i) >=20
y(i)=(35-x(i))/15;
else
y(i)=1;
end;
end;
%WARM
function y = Parobaya(x);
[m n] = size(x);
for i=1:n,
if x(i) <= 20
y(i) = 0;
elseif x(i) <= 35
y(i) = (x(i)-20)/15;
end;
end;
%HOT
function y = hot(x);
[m n] = size(x);
for i=1:n,
if x(i) <= 35
y(i) = 0;
elseif x(i) <= 50
y(i) = (x(i)-35)/15;
else
y(i) = 1;
end;
end;
%nb : (dikerjakan di command window)
% >>x=0:60 //buat alokasi nilai input x
% >>y1=Muda(x)
% >>y2=Parobaya(x)
% >>y3=Tua(x)
% >>plot(x,y1)](https://image.slidesharecdn.com/fuzzyfikasi-170517162311/75/Fuzzyfikasi-1-2048.jpg)

The document contains code for three functions - cold(), warm(), and hot() - that take temperature values as input and output a value between 0 and 1 indicating how cold, warm, or hot the temperature is. The cold() function outputs 0 for temperatures at or above 35 degrees, a linear scale from 0 to 1 for temperatures between 20-35 degrees, and 1 for temperatures below 20 degrees. The warm() function is similar but for temperatures between 20-35 degrees. The hot() function outputs 0 for temperatures at or below 35 degrees, a linear scale from 0 to 1 for temperatures between 35-50 degrees, and 1 for temperatures at or above 50 degrees.
![%artificial intellegent
%COLD
function y = cold(x);
[m n]=suhu(x);
for i=1:n,
if x(i) >=35
y(i) = 0;
else if x(i) >=20
y(i)=(35-x(i))/15;
else
y(i)=1;
end;
end;
%WARM
function y = Parobaya(x);
[m n] = size(x);
for i=1:n,
if x(i) <= 20
y(i) = 0;
elseif x(i) <= 35
y(i) = (x(i)-20)/15;
end;
end;
%HOT
function y = hot(x);
[m n] = size(x);
for i=1:n,
if x(i) <= 35
y(i) = 0;
elseif x(i) <= 50
y(i) = (x(i)-35)/15;
else
y(i) = 1;
end;
end;
%nb : (dikerjakan di command window)
% >>x=0:60 //buat alokasi nilai input x
% >>y1=Muda(x)
% >>y2=Parobaya(x)
% >>y3=Tua(x)
% >>plot(x,y1)](https://image.slidesharecdn.com/fuzzyfikasi-170517162311/75/Fuzzyfikasi-1-2048.jpg)