MEX file that writes the fuzzy model in an ASCII text file.
MATLAB help:
% FIS2TXT Writes the fuzzy model in an ASCII text file.
%
% fis2txt(Model,'File.txt')
%
% Arguments:
%
% Model -> This fuzzy model could be a '.txt' file, a '.fis' file,
% or a 'FIS' variable from MATLAB Workspace.
%
% 'File.txt' -> String with the name of file to write. This file will be
% overwrited without confirmation.
%
% See also activation, antec2mat, aproxjac, aproxlinear, conseq2mat, fuz2mat,
% fuzcomb, fuzeval, fuzjac, fuzlinear, fuzprint, mat2antec, mat2conseq,
% mat2fuz, fuzsubsystem, txt2fis
Source code:
void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
if(nrhs!=2)
{
sprintf(error,"%s %s, %s",E_NumberArg,O_OfIn,U_SeeHelp);
}
if (nlhs>0)
{
sprintf(error,"%s %s, %s",E_NumberArg,O_OfOut,U_SeeHelp);
}
for (int i=0;i<nrhs;i++)
if (mxIsEmpty(prhs[i]) || mxIsNaN(*mxGetPr(prhs[i])))
mexPrintf("Error using ==> fis2txt\n%s\n%s %s\n",E_FileOutput,U_OR,E_NoValidFP);
}