MEX file that reads a TXT fuzzy model and creates a FIS variable.
MATLAB help:
% TXT2FIS Reads a TXT fuzzy model and creates a FIS variable.
%
% FIS_Model = txt2fis('File.txt')
%
% Arguments:
%
% 'File.txt' -> String with the name of TXT-file to read.
%
% FIS_Model -> 'FIS' fuzzy model.
%
% See also activation, antec2mat, aproxjac, aproxlinear, conseq2mat, fis2txt,
% fuz2mat, fuzcomb, fuzeval, fuzjac, fuzlinear, fuzprint, mat2antec,
% mat2conseq, mat2fuz, fuzsubsystem
Source code:
#define MATLAB_BUFLEN ((mxGetM(prhs[0])*mxGetN(prhs[0])*sizeof(mxChar))+1)
void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
if(nrhs!=1)
if (nlhs>1)
if (mxIsEmpty(prhs[0]) || mxIsNaN(*mxGetPr(prhs[0])))
if(mxGetString(prhs[0],file,MATLAB_BUFLEN))
const char* names[] = {"name","type","andMethod","orMethod","defuzzMethod","impMethod","aggMethod","input","output","rule"};
mwSize dim[] = {1,1};
plhs[0] = mxCreateStructArray(2,dim,10,names);
{
mxDestroyArray(plhs[0]);
}
}