Octave cuenta desde hace poco con un toolbox de lógica difusa, del autor Markowsky L., quien en el International Workshop “Open-Source Software for Scientific Computation (OSSC) 2011” dictó una conferencia titulada The Octave Fuzzy Logic Toolkit llevada a cabo del 12 al 14 de octubre.
El paper se encuentra disponible en
http://ieeexplore.ieee.org/xpl/articleDetails.jsp?reload=true&arnumber=6184706
El software se encuentra disponible de forma gratuita en:
http://sourceforge.net/projects/octave-fuzzy/ y solo pesa unos 80kB, ya que se encuentra conformada por archivos .m
Para su instalación, en Linux, desde octave , en la linea de comando teclea lo siguiente:
>>>pkg install -forge fuzzy-logic-toolkit
de esta forma, automáticamente se instala el toolkit en octave.
Ahora tecleando:
>>>pkg list
Se muestran los paquetes instalados en nuestro sistema:
Package Name | Version | Installation directory
---------------------+---------+-----------------------
audio *| 1.1.4 | /usr/share/octave/packages/audio-1.1.4
control *| 2.4.0 | /usr/share/octave/packages/control-2.4.0
fuzzy-logic-toolkit | 0.4.2 | /home/miguel/octave/fuzzy-logic-toolkit-0.4.2
gnuplot *| 1.0.1 | /home/miguel/octave/gnuplot-1.0.1
gsl *| 1.0.8 | /usr/share/octave/packages/gsl-1.0.8
image *| 1.0.15 | /usr/share/octave/packages/image-1.0.15
miscellaneous *| 1.2.0 | /usr/share/octave/packages/miscellaneous-1.2.0
nnet *| 0.1.13 | /usr/share/octave/packages/nnet-0.1.13
odebvp *| 1.0.6 | /home/miguel/octave/odebvp-1.0.6
optim | 1.2.2 | /usr/share/octave/packages/optim-1.2.2
physicalconstants *| 0.1.7 | /home/miguel/octave/physicalconstants-0.1.7
quaternion *| 2.0.0 | /usr/share/octave/packages/quaternion-2.0.0
signal | 1.1.3 | /usr/share/octave/packages/signal-1.1.3
specfun | 1.1.0 | /usr/share/octave/packages/specfun-1.1.0
statistics *| 1.0.10 | /home/miguel/octave/statistics-1.0.10
struct | 1.0.10 | /usr/share/octave/packages/struct-1.0.10
symbolic *| 1.1.0 | /usr/share/octave/packages/symbolic-1.1.0
donde aquellos que tienen un '*' delante del nombre del paquete instalado, son los que se encuentran instalados. (si deseas instalar mas paquetes, puedes consultar la siguiente página)
http://octave.sourceforge.net/
Ahora como verán, el paquete de lógica borrosa no está cargado automáticamente, para cargarlo debe teclear lo siguiente
>>> pkg load fuzzy-logic-toolkit
En consecuencia, es posible usar ya funciones del toolkit
>>> demo('sigmf')
sigmf example 1:
x = 0:100;
params = [0.3 40];
y1 = sigmf(x, params);
params = [0.2 40];
y2 = sigmf(x, params);
params = [0.1 40];
y3 = sigmf(x, params);
figure('NumberTitle', 'off', 'Name', 'sigmf demo');
plot(x, y1, 'r;params = [0.3 40];', 'LineWidth', 2)
hold on;
plot(x, y2, 'b;params = [0.2 40];', 'LineWidth', 2)
hold on;
plot(x, y3, 'g;params = [0.1 40];', 'LineWidth', 2)
ylim([-0.1 1.2]);
xlabel('Crisp Input Value', 'FontWeight', 'bold');
ylabel('Degree of Membership', 'FontWeight', 'bold');
grid;
solo una advertencia, el comando load debe usarse siempre que se requiera usar el toolkit.
solo descarga el paquete tar.gz en alguna ubicación, y crean dentro de tu home un archivo opt
$makedir opt
y descomprime ahi el archivo descargado
ahora abre octave y desde la línea de comandos (http://iimyo.forja.rediris.es/tutorial/gui.html) teclea el siguiente comando
path(path,'/home/miguel/opt/fuzzy-logic-toolkit/')
y con esto, es posible usar las funciones del fuzzy-logic-toolkit, por ejemplo al usar
help trimf
`trimf' is a function from the file /home/miguel/opt/fuzzy-logic-toolkit/inst/t
rimf.m
-- Function File: Y = trimf (X, PARAMS)
-- Function File: Y = trimf ([X1 X2 ... XN], [A B C])
For a given domain X and parameters PARAMS (or [A B C]), return
the corresponding Y values for the triangular membership function.
The argument X must be a real number or a non-empty vector of
strictly increasing real numbers, and parameters A, B, and C must
be real numbers that satisfy A < B < C. None of the parameters A,
B, and C are required to be in the domain X. The minimum and
maximum values of the triangle are assumed to be 0 and 1.
The parameters [A B C] correspond to the x values of the vertices
of the triangle:
1-| /\
| / \
| / \
| / \
0-----------------------
a b c
To run the demonstration code, type demo('trimf') at the Octave
prompt.
See also: dsigmf, gauss2mf, gaussmf, gbellmf, pimf, psigmf, sigmf,
smf, trapmf, trimf_demo, zmf
Additional help for built-in functions and operators is
available in the on-line version of the manual. Use the command
`doc
' to search the manual index.
En la siguiente página podrás encontrar las referencias y las funciones con las que cuenta el toolkit
http://octave.sourceforge.net/fuzzy-logic-toolkit/overview.html
Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help@octave.org
mailing list.