From: Eng on
i'm a beginner in Matlab and i'm using the Fuzzy toolbox

I Create a MATLAB function, and save it in your current working folder and i need to refer to this function as a custom Membership function through the FIS GUI
when i select Edit > Membership Functions and i click add custom MF
i write the MF name and the M-file function name the same as the one in the function name of my M-file i put the params too

i get this

??? Reference to non-existent field 'mf'.

Error in ==> mfedit>localSelectmf at 1562
if length(eval(['fis.' varType '(' num2str(varIndex) ').mf'])) >= 1

Error in ==> mfedit at 547
localSelectmf([], [], selectColor);

Error in ==> fuzzy>localSelectVar at 1337
mfedit(fis,varType,varIndex);

??? Error while evaluating patch ButtonDownFcn

??? Reference to non-existent field 'mf'.

Error in ==> addmf at 42
MFindex=length(fis.input(varIndex).mf)+1;

Error in ==> cmfdlg at 261
fis=addmf(fis,varType,varIndex,mfName,mfType,mfParams);

??? Error while evaluating uicontrol Callback

although i'm putting the M-file in the same directory as the FIS file, also i put it in the matlab default path directory
i don't know what is wrong