How do I run the matlab function?

There is a function, tell me how to run it?

function mu=bellmf(x, params)
%bellmf – bell membership function;
%x – input vector;
%params(1) – concentration coefficient (>0);
%params(2) – coordinate of maximuma.
a=params(1);
b=params(2);
mu=1./(1+ ((x-b)/a).^2);
 1
Author: Даша Новикова, 2017-05-28

1 answers

In the command line (command window), you create a variable x and an array params with the size of 1x2. Next, on the command line, call the function mu=bellmf(x, params).

Example what should happen:

>> x = 1;
>> params = [1, 0];
>> mu=bellmf(x, params)

mu =

    0.5000

In general, I advise you to look at examples in matlab help.

 1
Author: GoDm0d, 2017-05-29 10:46:07