Vectorial use of membership functions
1 回表示 (過去 30 日間)
古いコメントを表示
Hello I have a family of membership functions, that is n s-shaped mf with different parameters. Then I have n points and each of them must be tested on a singular MF. I tried:
res = smf([x_1;x_2;..;x_n],[a_1 b_1;a_2 b_2;...; a_n b_n])
of course is not working. Is it possible to implement this problem with a singular instruction or shall I implement a cycle ?
0 件のコメント
回答 (1 件)
Sam Chak
2025 年 4 月 11 日
Here is a demo in which six different S-shaped membership functions are generated and evaluated at a target input using a for-loop approach. The results are then tabulated using the array2table() command.
%% settings
x = linspace(-1, 1, 201);
a = -0.5:0.1:0.0; % 1st parameter of smf
b = 0.0:0.1:0.5; % 2nd parameter of smf
y = zeros(numel(a), 2); % initialization
tgt = 0; % target
%% generate plots
hold on
for i = 1:numel(a)
mf = @(x) smf(x, [a(i), b(i)]);
y(i,:) = [mf(tgt), i];
plot(x, mf(x))
plot(tgt, mf(tgt), 'k.')
end
hold off
%% labels
grid on, ylim([-0.5, 1.5])
xlabel('x'), ylabel('Degree of membership')
title('A family of S-shaped membership functions')
T = array2table(y, 'VariableNames', {'mu', 'i'});
fprintf('The degree of membership evaluated at x = %.4f.\n', tgt); disp(T)
0 件のコメント
参考
カテゴリ
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!
