function c, sigma , W_output = SOFNN( X, d, Kd )%SOFNN Self-Organizing Fuzzy Neural Networks%Input Parameters% X(r,n) - rth traning data from nth observation% d(n) - the desired output of the network (must be a row vector)% Kd(r) - predefined distance threshold for the rth input%Output Parameters% c(IndexInputVariable,IndexNeuron)% sigma(IndexInputVariable,IndexNeuron)% W_output is a vector%Setting up Parameters for SOFNNSigmaZero=4;delta=0.12;threshold=0.1354;k_sigma=1.12;