What correction need in this..? for fuzzy
조회 수: 1 (최근 30일)
이전 댓글 표시
function out = Tanvismembershipfunction(x, params)
for i=1:length(x)
if x(i)<params(1)
y(i)= 2 * abs(x(i) - 0.5);
elseif x(i)<params(2)
y(i)= 2 * abs(x(i) - 0.5);
else x(i)<params(3)
y(i)= 2 * abs(x(i) - 0.5);
end
out=.1*y'; % scaling the output to lie between 0 and 1
댓글 수: 0
채택된 답변
Walter Roberson
2013년 1월 24일
There is no way to get that graph by just altering the params() values in that code.
Instead consider
y = 2 * abs(x - 0.5)
댓글 수: 2
추가 답변 (1개)
Jing
2013년 1월 24일
If you want to use it in a fuzzy logic/control problem, TRAPMF or TRIMF can easily create the function like that.
x=0:0.1:1;
y=1-trimf(x,[0 0.5 1]);
plot(x,y)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!