本文主要是介绍智能控制理论与应用(第四版)-第三章思考题与习题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
目录
思考题与习题3
3-1
3-2
(1)(P◦Q)◦R
(2)(P∪Q)◦S
(3)%(P◦S)∪(Q◦S)
3-3
3-4
思考题与习题3
3-1
解:由题意得,语气算子“很”即
所以“很年轻W”模糊集的隶属函数为
V为“不老也不年轻”,则
所以“不老也不年轻V”模糊集的隶属函数为
MATLAB仿真代码如下:
clear all;
close all;
%年老
for k1 = 1:1:2001x1(k1) = (k1-1)*0.1;if x1(k1)>=50&x1(k1)<=70y1(k1)=( x1(k1) -50)/20;elseif x1(k1)>70y1(k1) = 1.0;elsey1(k1) = 0;end
end
%年轻
for k = 1:1:2001x(k) = (k-1)*0.1;if x(k)>=0&x(k)<=25;y(k) = 1.0;elseif x(k)>25&x(k)<=70y(k)=(70 - x(k))/45;elsey(k) = 0;end
end
%很年轻
for k2 = 1:1:2001x2(k2) = (k2-1)*0.1;if x(k2)>=0&x(k2)<=25;y2(k2) = 1.0;elseif x(k2)>25&x(k2)<=70y2(k2)=((70 - x(k2))/45)^2;elsey2(k2) = 0;end
end
%不老也不年轻
for k3 = 1:1:2001x3(k3) = (k3-1)*0.1;if x(k3)>=25&x(k3)<=56.1;y3(k3) = 1-(70 - x3(k3))/45;elseif x(k3)>56.1&x(k3)<=70y3(k3)=1- (x3(k3) -50)/20;elsey3(k3) = 0;end
end
figure(1);
plot(x,y,'k');
xlabel('x Years');ylabel('Degree of membership');title('年老O')
figure(2)
plot(x1,y1,'k');
xlabel('x Years');ylabel('Degree of membership');title('年轻Y')
figure(3)
plot(x2,y2,'k');
xlabel('x Years');ylabel('Degree of membership');title('很年轻W')
figure(4)
plot(x3,y3,'k');
xlabel('x Years');ylabel('Degree of membership');title('不老也不年轻V')
3-2
(1)(P◦Q)◦R
MATLAB仿真代码如下:
clear all;
close all;P=[0.6,0.9;0.2,0.7];
Q=[0.5,0.7;0.1,0.4];
R=[0.2,0.3;0.7,0.7];
S=[0.1,0.2;0.6,0.5];%3.2.1
%P◦Q
for i=1:2for j=1:2PQ1(i,j)=max(min(P(i,:),Q(:,j)'))end
end
%(P◦Q)◦R
for i=1:2for j=1:2PQR(i,j)=max(min(PQ1(i,:),R(:,j)'))end
end
(2)(P∪Q)◦S
MATLAB仿真代码如下:
%3.2.2
%P∪Q
PQ2=max(P,Q)
%(P∪Q)◦S
for i=1:2for j=1:2PQS(i,j)=max(min(PQ2(i,:),S(:,j)'))end
end
(3)%(P◦S)∪(Q◦S)
MATLAB仿真代码如下:
%3.3.3
%P◦S
for i=1:2for j=1:2PS(i,j)=max(min(P(i,:),S(:,j)'))end
end
%Q◦S
for i=1:2for j=1:2QS(i,j)=max(min(Q(i,:),S(:,j)'))end
end
%(P◦S)∪(Q◦S)
for i=1:2for j=1:2PSQS(i,j)=max(min(PS(i,:),QS(:,j)'))end
end
3-3
MATLAB仿真代码如下:
% 定义模糊关系矩阵R和右侧矩阵B
R = [0.8, 0.5, 0.6; 0.4, 0.8, 0.5];
B = [0.5; 0.6]; % 设置最大迭代次数和收敛阈值
max_iter = 1000;
tol = 1e-6; % 调用函数求解模糊关系方程
X = solve_fuzzy_relation_equation(R, B, max_iter, tol); % 显示结果
disp(X);function X = solve_fuzzy_relation_equation(R, B, max_iter, tol) % R是模糊关系矩阵 (m x n) % B是右侧矩阵 (m x p) % max_iter是最大迭代次数 % tol是收敛阈值 % 获取矩阵的维度 [m, n] = size(R); [~, p] = size(B); % 初始化X矩阵,通常可以随机初始化或全部设为1 X = ones(n, p); % 迭代求解 for iter = 1:max_iter X_old = X; % 保存上一次迭代的X矩阵 % 执行模糊关系的合成运算 X_new = zeros(n, p); for i = 1:n for j = 1:p max_val = -inf; for k = 1:m val = min(R(k, i), B(k, j)); if val > max_val max_val = val; end end X_new(i, j) = max_val; end end % 检查收敛性 if norm(X_new - X_old, 'inf') < tol X = X_new; break; end X = X_new; end
end
3-4
MATLAB仿真代码如下:
clear all;
close all;A=[1;0.5];
B=[0.1,0.5,1];
C=[0.2,1];% Compound of A and B
AB=min(A,B);%Transfer to Column
AB_column = reshape(AB',6,1);
%Get fuzzy R
for i=1:6for j=1:2R(i,j)=min(AB_column(i),C(j));end
endA1=[0.8;0.1];
B1=[0.5,0.2,0];
% Compound of A1 and B1
AB1=min(A1,B1);
%Transfer to Row
AB1_column = reshape(AB1',1,6);%Get output C1
for i=1:6for j=1:2D(i,j)=min(AB1_column(i),R(i,j));C1(j)=max(D(:,j));end
end
disp(C1)
如有错误,请各位在评论区批评指正!
这篇关于智能控制理论与应用(第四版)-第三章思考题与习题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!