Kindly share the final code to run?

Write a MATLAB program to plot the LR MF.
Kindly share the final code to run in MATLAB.

回答(1 个)

Walter Roberson
Walter Roberson 2021-3-28
https://www.mathworks.com/matlabcentral/fileexchange/2173-neuro-fuzzy-and-soft-computing has the code in it... somewhere. (I tracked it down there four years ago.)

2 个评论

function y = lr_mf(x, parameter)
%LR_MF Left-right membership function with 3 parameters.
% J.-S. Roger Jang, 1993
c = parameter(1); alpha = parameter(2); beta = parameter(3);
index1 = find(x < c);
index2 = find(x >= c);
x1 = (c - x(index1))/alpha;
x2 = (x(index2) - c)/beta;
y1 = sqrt(max(1-x1.*x1, zeros(size(x1))));
y2 = exp(-abs(x2.*x2.*x2));
if size(x, 1) == 1,
y = [y1 y2];
else
y = [y1; y2];
end
What should I replace to run it?
That looks appropriate. You would call the function, passing in x values and the parameter vector, and you would store the output in a variable, and after that you would plot() the x values and the results of the call.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by