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.

Respuestas (1)

Walter Roberson
Walter Roberson el 28 de Mzo. de 2021

1 voto

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 comentarios

Prakul Jain
Prakul Jain el 28 de Mzo. de 2021
Editada: Walter Roberson el 28 de Mzo. de 2021
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?
Walter Roberson
Walter Roberson el 28 de Mzo. de 2021
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Mzo. de 2021

Comentada:

el 28 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by