This list is closed, nobody may subscribe to it.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(5) |
Sep
(3) |
Oct
(41) |
Nov
(41) |
Dec
(33) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(75) |
Feb
(10) |
Mar
(170) |
Apr
(174) |
May
(66) |
Jun
(11) |
Jul
(10) |
Aug
(44) |
Sep
(73) |
Oct
(28) |
Nov
(139) |
Dec
(52) |
2003 |
Jan
(35) |
Feb
(93) |
Mar
(62) |
Apr
(10) |
May
(55) |
Jun
(70) |
Jul
(37) |
Aug
(16) |
Sep
(56) |
Oct
(31) |
Nov
(57) |
Dec
(83) |
2004 |
Jan
(85) |
Feb
(67) |
Mar
(27) |
Apr
(37) |
May
(75) |
Jun
(85) |
Jul
(160) |
Aug
(68) |
Sep
(104) |
Oct
(25) |
Nov
(39) |
Dec
(23) |
2005 |
Jan
(10) |
Feb
(45) |
Mar
(43) |
Apr
(19) |
May
(108) |
Jun
(31) |
Jul
(41) |
Aug
(23) |
Sep
(65) |
Oct
(58) |
Nov
(44) |
Dec
(54) |
2006 |
Jan
(96) |
Feb
(27) |
Mar
(69) |
Apr
(59) |
May
(67) |
Jun
(35) |
Jul
(13) |
Aug
(461) |
Sep
(160) |
Oct
(399) |
Nov
(32) |
Dec
(72) |
2007 |
Jan
(316) |
Feb
(305) |
Mar
(318) |
Apr
(54) |
May
(194) |
Jun
(173) |
Jul
(282) |
Aug
(91) |
Sep
(227) |
Oct
(365) |
Nov
(168) |
Dec
(18) |
2008 |
Jan
(71) |
Feb
(111) |
Mar
(155) |
Apr
(173) |
May
(70) |
Jun
(67) |
Jul
(55) |
Aug
(83) |
Sep
(32) |
Oct
(68) |
Nov
(80) |
Dec
(29) |
2009 |
Jan
(46) |
Feb
(18) |
Mar
(95) |
Apr
(76) |
May
(140) |
Jun
(98) |
Jul
(84) |
Aug
(123) |
Sep
(94) |
Oct
(131) |
Nov
(142) |
Dec
(125) |
2010 |
Jan
(128) |
Feb
(158) |
Mar
(172) |
Apr
(134) |
May
(94) |
Jun
(84) |
Jul
(32) |
Aug
(127) |
Sep
(167) |
Oct
(109) |
Nov
(69) |
Dec
(78) |
2011 |
Jan
(39) |
Feb
(58) |
Mar
(52) |
Apr
(47) |
May
(56) |
Jun
(76) |
Jul
(55) |
Aug
(54) |
Sep
(165) |
Oct
(255) |
Nov
(328) |
Dec
(263) |
2012 |
Jan
(82) |
Feb
(147) |
Mar
(400) |
Apr
(216) |
May
(209) |
Jun
(160) |
Jul
(86) |
Aug
(141) |
Sep
(156) |
Oct
(6) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(2) |
2016 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
(8) |
Jul
(2) |
Aug
(5) |
Sep
(9) |
Oct
|
Nov
|
Dec
|
From: <par...@us...> - 2012-08-27 13:22:49
|
Revision: 10923 http://octave.svn.sourceforge.net/octave/?rev=10923&view=rev Author: paramaniac Date: 2012-08-27 13:22:35 +0000 (Mon, 27 Aug 2012) Log Message: ----------- control: prepare release of control-2.3.53 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE trunk/octave-forge/main/control/doc/control.pdf trunk/octave-forge/main/control/doc/control.tex trunk/octave-forge/main/control/doc/functions.texi Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-08-27 01:58:14 UTC (rev 10922) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-08-27 13:22:35 UTC (rev 10923) @@ -1,6 +1,6 @@ Name: Control Version: 2.3.53 -Date: 2012-08-14 +Date: 2012-08-27 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-08-27 01:58:14 UTC (rev 10922) +++ trunk/octave-forge/main/control/NEWS 2012-08-27 13:22:35 UTC (rev 10923) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.3.53 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +control-2.3.53 Release Date: 2012-08-27 Release Manager: Lukas Reichlin =============================================================================== ** Added new functions for system identification, including: Modified: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-08-27 01:58:14 UTC (rev 10922) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-08-27 13:22:35 UTC (rev 10923) @@ -21,12 +21,12 @@ rm -R ~/octave/__TEMP__/control/devel cd ~/octave/__TEMP__ grep -i version control/DESCRIPTION -tar czf control-2.3.52.tar.gz control/ -md5 control-2.3.52.tar.gz -md5 control-2.3.52.tar.gz > md5_control_pkg.txt -uuencode control-2.3.52.tar.gz < control-2.3.52.tar.gz > control-2.3.52.tar.gz.uue +tar czf control-2.3.53.tar.gz control/ +md5 control-2.3.53.tar.gz +md5 control-2.3.53.tar.gz > md5_control_pkg.txt +uuencode control-2.3.53.tar.gz < control-2.3.53.tar.gz > control-2.3.53.tar.gz.uue octave -q --eval \ -"pkg install control-2.3.52.tar.gz" +"pkg install control-2.3.53.tar.gz" octave -q --eval \ "pkg load generate_html; generate_package_html ('control', 'control-html', 'octave-forge')" tar czf control-html.tar.gz control-html @@ -41,7 +41,7 @@ ===================================================================================== rm -R ~/octave/__TEMP__ -rm -R ~/octave/control-2.3.52 +rm -R ~/octave/control-2.3.53 ===================================================================================== Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2012-08-27 01:58:14 UTC (rev 10922) +++ trunk/octave-forge/main/control/doc/control.pdf 2012-08-27 13:22:35 UTC (rev 10923) @@ -42,7 +42,7 @@ >> stream xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ -\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<K\xC9Ϫ\xA7檺l\xAA\xD7\xEF\xD5\xE9!GOaD\xC9W\xDA=\xF4bQ\xDDKf\x81\xA2\x89\x98-\xC9\xD4\xE8}\xF1\xBDH\xBE6\x8C\xBED\xF2\xE1\xE3p\xEC\xB7J\xA3<\x94\xC6]\x9E\xB7]\xBEY\xB6˾\xFB\xA1ӛy.\x9C\xBC\xED\x8Emֽ\xE7\xAB\xCF\xEC\xA7o\xA3r\xB5\xCD\xDA2\x9E \xB4\x8B\xA2-\xD7okU[\xD9fG\xEF\xE4J\xB3>c\xAC:EV\xBElV\xBB_\xC3\xF0\xEC\x8F(b\xA41\x8AO\x97Ps\x8E +\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<Kɏ\xD4SsU]6\xD5\xEB\xF7\xEA\xF4\x90#\x83\xA70"\x8Cd\x89+\xEDz\xB1\xA8\xEE\x8B%\xB3@\xD1D̖d j\x8C\x82\x83\xF4\xBE\xF8^$_F_"\xF9\xF0q8\xF6[\xA5QJ\xE3.\xCF\xDB.\xDFk\xC5,\xDBe_\x8B\xFDP\x8A\xE9\xCD<N\xDEv\xC76\xEB\xDE\xF3\xD5g\xF6ӷ\xD1\xB9\xDAfmO\xDA\xC5 |
From: <car...@us...> - 2012-08-27 01:58:20
|
Revision: 10922 http://octave.svn.sourceforge.net/octave/?rev=10922&view=rev Author: carandraug Date: 2012-08-27 01:58:14 +0000 (Mon, 27 Aug 2012) Log Message: ----------- xcorr2: check if input is 2D only Modified Paths: -------------- trunk/octave-forge/main/signal/inst/xcorr2.m Modified: trunk/octave-forge/main/signal/inst/xcorr2.m =================================================================== --- trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-27 01:53:16 UTC (rev 10921) +++ trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-27 01:58:14 UTC (rev 10922) @@ -64,6 +64,9 @@ ## will fail with "`a' undefined" error rather that print_usage b = a; endif + if (ndims (a) != 2 || ndims (b) != 2) + error ("xcorr2: input matrices must must have only 2 dimensions"); + endif ## compute correlation [ma,na] = size(a); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-27 01:53:24
|
Revision: 10921 http://octave.svn.sourceforge.net/octave/?rev=10921&view=rev Author: carandraug Date: 2012-08-27 01:53:16 +0000 (Mon, 27 Aug 2012) Log Message: ----------- xcorr2: fix bug on norm option when input is not double Modified Paths: -------------- trunk/octave-forge/main/signal/inst/xcorr2.m Modified: trunk/octave-forge/main/signal/inst/xcorr2.m =================================================================== --- trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-27 01:51:54 UTC (rev 10920) +++ trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-27 01:53:16 UTC (rev 10921) @@ -94,6 +94,10 @@ c = c/max(c(:))'; case {"norm"} + ## FIXME maybe these conversions for double can be removed when + ## https://savannah.gnu.org/bugs/?37199 gets fixed? + a = double (a); + b = double (b); a = conv2 (a.^2, ones (size (b))); b = dot (b(:), b(:)); c(:,:) = c(:,:) ./ sqrt (a(:,:) * b); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-27 01:52:02
|
Revision: 10920 http://octave.svn.sourceforge.net/octave/?rev=10920&view=rev Author: carandraug Date: 2012-08-27 01:51:54 +0000 (Mon, 27 Aug 2012) Log Message: ----------- xcorr2: fix bug when no arguments are passed Modified Paths: -------------- trunk/octave-forge/main/signal/inst/xcorr2.m Modified: trunk/octave-forge/main/signal/inst/xcorr2.m =================================================================== --- trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-26 19:32:20 UTC (rev 10919) +++ trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-27 01:51:54 UTC (rev 10920) @@ -21,8 +21,8 @@ ## @deftypefnx {Function File} {@var{c} =} xcorr2 (@dots{}, @var{scale}) ## Compute the 2D cross-correlation of matrices @var{a} and @var{b}. ## -## If @var{b} is not specified, it defaults to the same matrix as @var{a}, i.e., -## same as @code{xcorr(@var{a}, @var{a})}. +## If @var{b} is not specified, computes autocorrelation of @var{a}, i.e., +## same as @code{xcorr (@var{a}, @var{a})}. ## ## The optional argument @var{scale}, defines the type of scaling applied to the ## cross-correlation matrix. Possible values are: @@ -51,13 +51,18 @@ ## @seealso{conv2, corr2, xcorr} ## @end deftypefn -function c = xcorr2 (a, b = a, biasflag = "none") +function c = xcorr2 (a, b, biasflag = "none") if (nargin < 1 || nargin > 3) print_usage; elseif (nargin == 2 && ischar (b)) biasflag = b; b = a; + elseif (nargin == 1) + ## we have to set this case here instead of the function line, because if + ## someone calls the function with zero argument, since a is never set, we + ## will fail with "`a' undefined" error rather that print_usage + b = a; endif ## compute correlation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-26 19:32:26
|
Revision: 10919 http://octave.svn.sourceforge.net/octave/?rev=10919&view=rev Author: paramaniac Date: 2012-08-26 19:32:20 +0000 (Sun, 26 Aug 2012) Log Message: ----------- control: fix typos in doc Modified Paths: -------------- trunk/octave-forge/main/control/inst/test_control.m Modified: trunk/octave-forge/main/control/inst/test_control.m =================================================================== --- trunk/octave-forge/main/control/inst/test_control.m 2012-08-26 18:16:46 UTC (rev 10918) +++ trunk/octave-forge/main/control/inst/test_control.m 2012-08-26 19:32:20 UTC (rev 10919) @@ -19,8 +19,9 @@ ## @deftypefn {Script File} {} test_control ## Execute all available tests at once. ## The Octave control package is based on the @uref{http://www.slicot.org, @acronym{SLICOT}} library. -## @acronym{SLICOT} needs @acronym{BLAS} and @acronym{LAPACK} libraries which are also prerequisite for Octave itself. -## In case of failing test, it is highly recommended to use +## @acronym{SLICOT} needs @acronym{BLAS} and @acronym{LAPACK} libraries which are also prerequisites +## for Octave itself. +## In case of failing tests, it is highly recommended to use ## @uref{http://www.netlib.org/blas/, Netlib's reference @acronym{BLAS}} and ## @uref{http://www.netlib.org/lapack/, @acronym{LAPACK}} ## for building Octave. Using @acronym{ATLAS} may lead to sign changes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-26 18:16:52
|
Revision: 10918 http://octave.svn.sourceforge.net/octave/?rev=10918&view=rev Author: paramaniac Date: 2012-08-26 18:16:46 +0000 (Sun, 26 Aug 2012) Log Message: ----------- control: doc fixes Modified Paths: -------------- trunk/octave-forge/main/control/inst/test_control.m Modified: trunk/octave-forge/main/control/inst/test_control.m =================================================================== --- trunk/octave-forge/main/control/inst/test_control.m 2012-08-26 15:46:40 UTC (rev 10917) +++ trunk/octave-forge/main/control/inst/test_control.m 2012-08-26 18:16:46 UTC (rev 10918) @@ -18,20 +18,21 @@ ## -*- texinfo -*- ## @deftypefn {Script File} {} test_control ## Execute all available tests at once. -## The Octave control package is based on the @uref{http://www.slicot.org, SLICOT} library. -## SLICOT needs a LAPACK library which is also a prerequisite for Octave itself. +## The Octave control package is based on the @uref{http://www.slicot.org, @acronym{SLICOT}} library. +## @acronym{SLICOT} needs @acronym{BLAS} and @acronym{LAPACK} libraries which are also prerequisite for Octave itself. ## In case of failing test, it is highly recommended to use -## @uref{http://www.netlib.org/lapack/, Netlib's reference LAPACK} -## for building Octave. Using ATLAS may lead to sign changes -## in some entries in the state-space matrices. +## @uref{http://www.netlib.org/blas/, Netlib's reference @acronym{BLAS}} and +## @uref{http://www.netlib.org/lapack/, @acronym{LAPACK}} +## for building Octave. Using @acronym{ATLAS} may lead to sign changes +## in some entries of the state-space matrices. ## In general, these sign changes are not 'wrong' and can be regarded as ## the result of state transformations. Such state transformations ## (but not input/output transformations) have no influence on the ## input-output behaviour of the system. For better numerics, ## the control package uses such transformations by default when ## calculating the frequency responses and a few other things. -## However, arguments like the Hankel singular Values (HSV) must not change. -## Differing HSVs and failing algorithms are known for using Framework Accelerate +## However, arguments like the Hankel singular Values (@acronym{HSV}) must not change. +## Differing @acronym{HSV}s and failing algorithms are known for using Framework Accelerate ## from Mac OS X 10.7. ## @end deftypefn This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-26 15:46:47
|
Revision: 10917 http://octave.svn.sourceforge.net/octave/?rev=10917&view=rev Author: carandraug Date: 2012-08-26 15:46:40 +0000 (Sun, 26 Aug 2012) Log Message: ----------- fuzzy-logica-toolkit: * DESCRIPTION: short version of license name to keep downstream maintainers happy * NEWS: remove non user-visible changes Modified Paths: -------------- trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION trunk/octave-forge/main/fuzzy-logic-toolkit/NEWS Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION 2012-08-26 14:54:54 UTC (rev 10916) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION 2012-08-26 15:46:40 UTC (rev 10917) @@ -7,6 +7,6 @@ Description: A mostly MATLAB-compatible fuzzy logic toolkit for Octave. Depends: octave (>= 3.2.4) Autoload: no -License: GPL version 3 or later +License: GPLv3+ Url: http://octave.sf.net http://sf.net/projects/octave-fuzzy Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/NEWS =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/NEWS 2012-08-26 14:54:54 UTC (rev 10916) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/NEWS 2012-08-26 15:46:40 UTC (rev 10917) @@ -1,8 +1,6 @@ Summary of important user-visible changes for fuzzy-logic-toolkit 0.4.1: ------------------------------------------------------------------------ - ** GPLv2 was replaced with GPLv3 to fix inconsistency with source files. - ** The package is no longer automatically loaded. ** The following demo scripts were rewritten and embedded in fcm.m, @@ -16,10 +14,6 @@ (The separate demo script files have been removed.) - ** Many trivial changes were made to source file line length and - copyright notices. - - Summary of important user-visible changes for fuzzy-logic-toolkit 0.4.0: ------------------------------------------------------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lm...@us...> - 2012-08-26 14:55:03
|
Revision: 10916 http://octave.svn.sourceforge.net/octave/?rev=10916&view=rev Author: lmarkov Date: 2012-08-26 14:54:54 +0000 (Sun, 26 Aug 2012) Log Message: ----------- M fuzzy-logic-toolkit/ChangeLog M fuzzy-logic-toolkit/INDEX M fuzzy-logic-toolkit/COPYING M fuzzy-logic-toolkit/NEWS M fuzzy-logic-toolkit/DESCRIPTION Modified Paths: -------------- trunk/octave-forge/main/fuzzy-logic-toolkit/COPYING trunk/octave-forge/main/fuzzy-logic-toolkit/ChangeLog trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION trunk/octave-forge/main/fuzzy-logic-toolkit/INDEX trunk/octave-forge/main/fuzzy-logic-toolkit/NEWS Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/COPYING =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/COPYING 2012-08-26 14:54:12 UTC (rev 10915) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/COPYING 2012-08-26 14:54:54 UTC (rev 10916) @@ -1,283 +1,625 @@ GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + Version 3, 29 June 2007 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. <http://fsf.org/> + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". + TERMS AND CONDITIONS -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. + 0. Definitions. - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. + "This License" refers to version 3 of the GNU General Public License. -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. + A "covered work" means either the unmodified Program or a work based +on the Program. - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: + 1. Source Code. - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. + The Corresponding Source for a work in source code form is that +same work. - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of this License. - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. + 13. Use with the GNU Affero General Public License. -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. + 14. Revised Versions of this License. - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. - NO WARRANTY + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. + 15. Disclaimer of Warranty. - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest @@ -286,15 +628,15 @@ To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least +state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -303,35 +645,30 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. + along with this program. If not, see <http://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/ChangeLog =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/ChangeLog 2012-08-26 14:54:12 UTC (rev 10915) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/ChangeLog 2012-08-26 14:54:54 UTC (rev 10916) @@ -1,11 +1,22 @@ -2012-08-22 L. Markowsky <lm...@us...> +2012-08-26 L. Markowsky <lm...@us...> * Version 0.4.1 released. * ChangeLog: Updated file. + * COPYING: Replaced GPLv2 with GPLv3 (to fix inconsistency with source files). * DESCRIPTION: Updated file. + * INDEX: Updated file. + * NEWS: Updated file. + * inst/fcm.m: Rewrote and embedded the demos previously contained in + fcm_demo_1.m and fcm_demo_2.m. + * inst/fcm_demo_1.m: Removed script file. + * inst/fcm_demo_2.m: Removed script file. + * inst/gustafson_kessel.m: Rewrote and embedded the demos previously + contained in gustafson_kessel_demo_1.m and gustafson_kessel_demo_2.m. + * inst/gustafson_kessel_demo_1.m: Removed script file. + * inst/gustafson_kessel_demo_2.m: Removed script file. * inst/*.m: Many trivial changes to line length and copyright notices. * inst/private/*.m: Many trivial changes to line length and copyright notice. - * All demos tested under: Fedora 16/Octave 3.4.3 + * All demos tested under: Fedora 17/Octave 3.6.2 2012-07-10 L. Markowsky <lm...@us...> Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION 2012-08-26 14:54:12 UTC (rev 10915) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION 2012-08-26 14:54:54 UTC (rev 10916) @@ -1,12 +1,12 @@ Name: fuzzy-logic-toolkit Version: 0.4.1 -Date: 2012-08-22 +Date: 2012-08-26 Author: L. Markowsky <lm...@us...> Maintainer: L. Markowsky <lm...@us...> Title: Octave Fuzzy Logic Toolkit Description: A mostly MATLAB-compatible fuzzy logic toolkit for Octave. Depends: octave (>= 3.2.4) -Autoload: yes -License: GPL version 2 or later +Autoload: no +License: GPL version 3 or later Url: http://octave.sf.net http://sf.net/projects/octave-fuzzy Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/INDEX =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/INDEX 2012-08-26 14:54:12 UTC (rev 10915) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/INDEX 2012-08-26 14:54:54 UTC (rev 10916) @@ -61,13 +61,9 @@ mamdani_tip_demo sugeno_tip_demo -Fuzzy Clustering Functions and Demos +Fuzzy Clustering Functions fcm - fcm_demo_1 - fcm_demo_2 gustafson_kessel - gustafson_kessel_demo_1 - gustafson_kessel_demo_2 partition_coeff partition_entropy xie_beni_index Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/NEWS =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/NEWS 2012-08-26 14:54:12 UTC (rev 10915) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/NEWS 2012-08-26 14:54:54 UTC (rev 10916) @@ -1,3 +1,25 @@ +Summary of important user-visible changes for fuzzy-logic-toolkit 0.4.1: +------------------------------------------------------------------------ + + ** GPLv2 was replaced with GPLv3 to fix inconsistency with source files. + + ** The package is no longer automatically loaded. + + ** The following demo scripts were rewritten and embedded in fcm.m, + gustafson_kessel.m, partition_coeff.m, partition_entropy.m, and + xie_beni_index.m: + + fcm_demo_1 + fcm_demo_2 + gustafson_kessel_demo_1 + gustafson_kessel_demo_2 + + (The separate demo script files have been removed.) + + ** Many trivial changes were made to source file line length and + copyright notices. + + Summary of important user-visible changes for fuzzy-logic-toolkit 0.4.0: ------------------------------------------------------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lm...@us...> - 2012-08-26 14:54:19
|
Revision: 10915 http://octave.svn.sourceforge.net/octave/?rev=10915&view=rev Author: lmarkov Date: 2012-08-26 14:54:12 +0000 (Sun, 26 Aug 2012) Log Message: ----------- M inst/fcm.m M inst/xie_beni_index.m M inst/gustafson_kessel.m D inst/fcm_demo_1.m M inst/partition_entropy.m D inst/fcm_demo_2.m D inst/gustafson_kessel_demo_1.m D inst/gustafson_kessel_demo_2.m M inst/partition_coeff.m Modified Paths: -------------- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_coeff.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_entropy.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/xie_beni_index.m Removed Paths: ------------- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_1.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_2.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_1.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_2.m Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -106,7 +106,7 @@ ## @end group ## @end example ## -## @seealso{fcm_demo_1, fcm_demo_2, gustafson_kessel, gustafson_kessel_demo_1, gustafson_kessel_demo_2, partition_coeff, partition_entropy, xie_beni_index} +## @seealso{gustafson_kessel, partition_coeff, partition_entropy, xie_beni_index} ## ## @end deftypefn @@ -114,7 +114,7 @@ ## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: fcm.m -## Last-Modified: 19 Aug 2012 +## Last-Modified: 26 Aug 2012 function [cluster_centers, soft_partition, obj_fcn_history] = ... fcm (input_data, num_clusters, options = [2.0, 100, 1e-5, 1]) @@ -212,3 +212,126 @@ endif endfunction + +##---------------------------------------------------------------------- +## FCM Demo #1 +##---------------------------------------------------------------------- + +%!demo +%! ## This demo: +%! ## - classifies a small set of unlabeled data points using the +%! ## Fuzzy C-Means algorithm into two fuzzy clusters +%! ## - plots the input points together with the cluster centers +%! ## +%! ## Note: The input_data is taken from Chapter 13, Example 17 in +%! ## Fuzzy Logic: Intelligence, Control and Information, by +%! ## J. Yen and R. Langari, Prentice Hall, 1999, page 381 +%! ## (International Edition). +%! +%! ## Use fcm to classify the input_data. +%! input_data = [2 12; 4 9; 7 13; 11 5; 12 7; 14 4]; +%! number_of_clusters = 2; +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! fcm (input_data, number_of_clusters) +%! +%! ## Plot the data points as small blue x's. +%! figure ('NumberTitle', 'off', 'Name', 'FCM Demo 1'); +%! for i = 1 : rows (input_data) +%! plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... +%! 'marker', 'x', 'color', 'b'); +%! hold on; +%! endfor +%! +%! ## Plot the cluster centers as larger red *'s. +%! for i = 1 : number_of_clusters +%! plot (cluster_centers(i, 1), cluster_centers(i, 2), ... +%! 'LineWidth', 4, 'marker', '*', 'color', 'r'); +%! hold on; +%! endfor +%! +%! ## Make the figure look a little better: +%! ## - scale and label the axes +%! ## - show gridlines +%! xlim ([0 15]); +%! ylim ([0 15]); +%! xlabel ('Feature 1'); +%! ylabel ('Feature 2'); +%! grid +%! hold + +##---------------------------------------------------------------------- +## FCM Demo #2 +##---------------------------------------------------------------------- + +%!demo +%! ## This demo: +%! ## - classifies three-dimensional unlabeled data points using the +%! ## Fuzzy C-Means algorithm into three fuzzy clusters +%! ## - plots the input points together with the cluster centers +%! ## +%! ## Note: The input_data was selected to form three areas of +%! ## different shapes. +%! +%! ## Use fcm to classify the input_data. +%! input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; +%! 3 12 5; 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; +%! 3 5 11; 4 4 9; 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; +%! 9 12 13; 9 13 14; 10 9 13; 10 13 12; 11 10 14; +%! 11 12 13; 12 6 12; 12 7 15; 12 9 15; 14 6 14; 14 8 13]; +%! number_of_clusters = 3; +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! fcm (input_data, number_of_clusters, [NaN NaN NaN 0]) +%! +%! ## Plot the data points in two dimensions (using features 1 & 2) +%! ## as small blue x's. +%! figure ('NumberTitle', 'off', 'Name', 'FCM Demo 2'); +%! for i = 1 : rows (input_data) +%! plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... +%! 'marker', 'x', 'color', 'b'); +%! hold on; +%! endfor +%! +%! ## Plot the cluster centers in two dimensions (using features 1 & 2) +%! ## as larger red *'s. +%! for i = 1 : number_of_clusters +%! plot (cluster_centers(i, 1), cluster_centers(i, 2), ... +%! 'LineWidth', 4, 'marker', '*', 'color', 'r'); +%! hold on; +%! endfor +%! +%! ## Make the figure look a little better: +%! ## - scale and label the axes +%! ## - show gridlines +%! xlim ([0 15]); +%! ylim ([0 15]); +%! xlabel ('Feature 1'); +%! ylabel ('Feature 2'); +%! grid +%! hold +%! +%! ## Plot the data points in two dimensions (using features 1 & 3) +%! ## as small blue x's. +%! figure ('NumberTitle', 'off', 'Name', 'FCM Demo 2'); +%! for i = 1 : rows (input_data) +%! plot (input_data(i, 1), input_data(i, 3), 'LineWidth', 2, ... +%! 'marker', 'x', 'color', 'b'); +%! hold on; +%! endfor +%! +%! ## Plot the cluster centers in two dimensions (using features 1 & 3) +%! ## as larger red *'s. +%! for i = 1 : number_of_clusters +%! plot (cluster_centers(i, 1), cluster_centers(i, 3), ... +%! 'LineWidth', 4, 'marker', '*', 'color', 'r'); +%! hold on; +%! endfor +%! +%! ## Make the figure look a little better: +%! ## - scale and label the axes +%! ## - show gridlines +%! xlim ([0 15]); +%! ylim ([0 15]); +%! xlabel ('Feature 1'); +%! ylabel ('Feature 3'); +%! grid +%! hold Deleted: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_1.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_1.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_1.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -1,94 +0,0 @@ -## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> -## -## This file is part of the fuzzy-logic-toolkit. -## -## The fuzzy-logic-toolkit is free software; you can redistribute it -## and/or modify it under the terms of the GNU General Public License -## as published by the Free Software Foundation; either version 3 of -## the License, or (at your option) any later version. -## -## The fuzzy-logic-toolkit is distributed in the hope that it will be -## useful, but WITHOUT ANY WARRANTY; without even the implied warranty -## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with the fuzzy-logic-toolkit; see the file COPYING. If not, -## see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Script File} {} fcm_demo_1 -## Use the Fuzzy C-Means algorithm to classify a small set of unlabeled -## data points and evaluate the quality of the resulting clusters. -## -## This demo: -## @itemize @minus -## @item -## classifies a small set of unlabeled data points using the Fuzzy C-Means -## algorithm into two fuzzy clusters -## @item -## calculates and prints (on standard output) three validity measures: -## the partition coefficient, the partition entropy, and the Xie-Beni -## validity index -## @item -## plots the input points together with the cluster centers -## @end itemize -## -## For a description of the data structures used in the script, see the -## documentation for fcm. -## -## @seealso{fcm, fcm_demo_2, partition_coeff, partition_entropy, xie_beni_index, gustafson_kessel, gustafson_kessel_demo_1, gustafson_kessel_demo_2} -## -## @end deftypefn - -## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm -## Directory: fuzzy-logic-toolkit/inst/ -## Filename: fcm_demo_1.m -## Last-Modified: 19 Aug 2012 - -##---------------------------------------------------------------------- -## Note: The input_data is taken from Chapter 13, Example 17 in -## Fuzzy Logic: Intelligence, Control and Information, by J. Yen -## and R. Langari, Prentice Hall, 1999, page 381 (International -## Edition). -##---------------------------------------------------------------------- - -## Use fcm to classify the data in matrix x. -input_data = [2 12; 4 9; 7 13; 11 5; 12 7; 14 4] -number_of_clusters = 2 -[cluster_centers, soft_partition, obj_fcn_history] = ... - fcm (input_data, number_of_clusters) - -## Calculate and print the three validity measures. -printf ("Partition Coefficient: %f\n", ... - partition_coeff (soft_partition)); -printf ("Partition Entropy (with a = 2): %f\n", ... - partition_entropy (soft_partition, 2)); -printf ("Xie-Beni Index: %f\n\n", ... - xie_beni_index (input_data, cluster_centers, soft_partition)); - -## Plot the data points as small blue x's. -figure ('NumberTitle', 'off', 'Name', 'FCM Demo 1'); -for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... - 'marker', 'x', 'color', 'b'); - hold on; -endfor - -## Plot the cluster centers as larger red *'s. -for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', ... - 4, 'marker', '*', 'color', 'r'); - hold on; -endfor - -## Make the figure look a little better: -## -- scale and label the axes -## -- show gridlines -xlim ([0 15]); -ylim ([0 15]); -xlabel ('Feature 1'); -ylabel ('Feature 2'); -grid -hold Deleted: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_2.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_2.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_2.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -1,125 +0,0 @@ -## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> -## -## This file is part of the fuzzy-logic-toolkit. -## -## The fuzzy-logic-toolkit is free software; you can redistribute it -## and/or modify it under the terms of the GNU General Public License -## as published by the Free Software Foundation; either version 3 of -## the License, or (at your option) any later version. -## -## The fuzzy-logic-toolkit is distributed in the hope that it will be -## useful, but WITHOUT ANY WARRANTY; without even the implied warranty -## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with the fuzzy-logic-toolkit; see the file COPYING. If not, -## see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Script File} {} fcm_demo_2 -## Use the Fuzzy C-Means algorithm to classify three-dimensional unlabeled -## data points and evaluate the quality of the resulting clusters. -## -## The demo: -## @itemize @minus -## @item -## classifies three-dimensional unlabeled data points using the Fuzzy -## C-Means algorithm into three fuzzy clusters -## @item -## calculates and prints (on standard output) three validity measures: -## the partition coefficient, the partition entropy, and the Xie-Beni -## validity index -## @item -## plots the input points together with the cluster centers -## @end itemize -## -## For a description of the data structures used in the script, see the -## documentation for fcm. -## -## @seealso{fcm, fcm_demo_1, partition_coeff, partition_entropy, xie_beni_index, gustafson_kessel, gustafson_kessel_demo_1, gustafson_kessel_demo_2} -## -## @end deftypefn - -## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm -## Directory: fuzzy-logic-toolkit/inst/ -## Filename: fcm_demo_2.m -## Last-Modified: 19 Aug 2012 - -##---------------------------------------------------------------------- -## Note: The input_data was selected to form three areas of different -## shapes. -##---------------------------------------------------------------------- - -## Use fcm to classify the data in matrix x. -input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; - 3 12 5; 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; - 3 5 11; 4 4 9; 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; - 9 12 13; 9 13 14; 10 9 13; 10 13 12; 11 10 14; 11 12 13; - 12 6 12; 12 7 15; 12 9 15; 14 6 14; 14 8 13] -number_of_clusters = 3 -[cluster_centers, soft_partition, obj_fcn_history] = ... - fcm (input_data, number_of_clusters, [NaN NaN NaN 0]) - -## Calculate and print the three validity measures. -printf ("Partition Coefficient: %f\n", ... - partition_coeff (soft_partition)); -printf ("Partition Entropy (with a = 2): %f\n", ... - partition_entropy (soft_partition, 2)); -printf ("Xie-Beni Index: %f\n\n", ... - xie_beni_index (input_data, cluster_centers, soft_partition)); - -## Plot the data points in two dimensions (using features 1 and 2) -## as small blue x's. -figure ('NumberTitle', 'off', 'Name', 'FCM Demo 2'); -for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... - 'marker', 'x', 'color', 'b'); - hold on; -endfor - -## Plot the cluster centers in two dimensions (using features 1 and 2) -## as larger red *'s. -for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', ... - 4, 'marker', '*', 'color', 'r'); - hold on; -endfor - -## Make the figure look a little better: -## -- scale and label the axes -## -- show gridlines -xlim ([0 15]); -ylim ([0 15]); -xlabel ('Feature 1'); -ylabel ('Feature 2'); -grid -hold - -## Plot the data points in two dimensions (using features 1 and 3) -## as small blue x's. -figure ('NumberTitle', 'off', 'Name', 'FCM Demo 2'); -for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 3), 'LineWidth', 2, ... - 'marker', 'x', 'color', 'b'); - hold on; -endfor - -## Plot the cluster centers in two dimensions (using features 1 and 3) -## as larger red *'s. -for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 3), 'LineWidth', ... - 4, 'marker', '*', 'color', 'r'); - hold on; -endfor - -## Make the figure look a little better: -## -- scale and label the axes -## -- show gridlines -xlim ([0 15]); -ylim ([0 15]); -xlabel ('Feature 1'); -ylabel ('Feature 3'); -grid -hold Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -111,7 +111,7 @@ ## @end group ## @end example ## -## @seealso{fcm, fcm_demo_1, fcm_demo_2, gustafson_kessel_demo_1, gustafson_kessel_demo_2, partition_coeff, partition_entropy, xie_beni_index} +## @seealso{fcm, partition_coeff, partition_entropy, xie_beni_index} ## ## @end deftypefn @@ -119,7 +119,7 @@ ## Keywords: fuzzy-logic-toolkit fuzzy partition clustering ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: gustafson_kessel.m -## Last-Modified: 20 Aug 2012 +## Last-Modified: 26 Aug 2012 function [cluster_centers, soft_partition, obj_fcn_history] = ... gustafson_kessel (input_data, num_clusters, ... @@ -283,3 +283,125 @@ endfunction +##---------------------------------------------------------------------- +## Gustafson-Kessel Demo #1 +##---------------------------------------------------------------------- + +%!demo +%! ## This demo: +%! ## - classifies a small set of unlabeled data points using the +%! ## Gustafson-Kessel algorithm into two fuzzy clusters +%! ## - plots the input points together with the cluster centers +%! ## +%! ## Note: The input_data is taken from Chapter 13, Example 17 in +%! ## Fuzzy Logic: Intelligence, Control and Information, by +%! ## J. Yen and R. Langari, Prentice Hall, 1999, page 381 +%! ## (International Edition). +%! +%! ## Use gustafson_kessel to classify the input_data. +%! input_data = [2 12; 4 9; 7 13; 11 5; 12 7; 14 4]; +%! number_of_clusters = 2; +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! gustafson_kessel (input_data, number_of_clusters) +%! +%! ## Plot the data points as small blue x's. +%! figure ('NumberTitle', 'off', 'Name', 'Gustafson-Kessel Demo 1'); +%! for i = 1 : rows (input_data) +%! plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... +%! 'marker', 'x', 'color', 'b'); +%! hold on; +%! endfor +%! +%! ## Plot the cluster centers as larger red *'s. +%! for i = 1 : number_of_clusters +%! plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', ... +%! 4, 'marker', '*', 'color', 'r'); +%! hold on; +%! endfor +%! +%! ## Make the figure look a little better: +%! ## - scale and label the axes +%! ## - show gridlines +%! xlim ([0 15]); +%! ylim ([0 15]); +%! xlabel ('Feature 1'); +%! ylabel ('Feature 2'); +%! grid +%! hold + +##---------------------------------------------------------------------- +## Gustafson-Kessel Demo #2 +##---------------------------------------------------------------------- + +%!demo +%! ## This demo: +%! ## - classifies three-dimensional unlabeled data points using the +%! ## Gustafson-Kessel algorithm into three fuzzy clusters +%! ## - plots the input points together with the cluster centers +%! ## +%! ## Note: The input_data was selected to form three areas of +%! ## different shapes. +%! +%! ## Use gustafson_kessel to classify the input_data. +%! input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; +%! 3 12 5; 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; +%! 3 5 11; 4 4 9; 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; +%! 9 12 13; 9 13 14; 10 9 13; 10 13 12; 11 10 14; +%! 11 12 13; 12 6 12; 12 7 15; 12 9 15; 14 6 14; 14 8 13]; +%! number_of_clusters = 3; +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! gustafson_kessel (input_data, number_of_clusters, [1 1 1], ... +%! [NaN NaN NaN 0]) +%! +%! ## Plot the data points in two dimensions (using features 1 & 2) +%! ## as small blue x's. +%! figure ('NumberTitle', 'off', 'Name', 'Gustafson-Kessel Demo 2'); +%! for i = 1 : rows (input_data) +%! plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... +%! 'marker', 'x', 'color', 'b'); +%! hold on; +%! endfor +%! +%! ## Plot the cluster centers in two dimensions (using features 1 & 2) +%! ## as larger red *'s. +%! for i = 1 : number_of_clusters +%! plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', ... +%! 4, 'marker', '*', 'color', 'r'); +%! hold on; +%! endfor +%! +%! ## Make the figure look a little better: +%! ## - scale and label the axes +%! ## - show gridlines +%! xlim ([0 15]); +%! ylim ([0 15]); +%! xlabel ('Feature 1'); +%! ylabel ('Feature 2'); +%! grid +%! +%! ## Plot the data points in two dimensions (using features 1 & 3) +%! ## as small blue x's. +%! figure ('NumberTitle', 'off', 'Name', 'Gustafson-Kessel Demo 2'); +%! for i = 1 : rows (input_data) +%! plot (input_data(i, 1), input_data(i, 3), 'LineWidth', 2, ... +%! 'marker', 'x', 'color', 'b'); +%! hold on; +%! endfor +%! +%! ## Plot the cluster centers in two dimensions (using features 1 & 3) +%! ## as larger red *'s. +%! for i = 1 : number_of_clusters +%! plot (cluster_centers(i, 1), cluster_centers(i, 3), 'LineWidth', ... +%! 4, 'marker', '*', 'color', 'r'); +%! hold on; +%! endfor +%! +%! ## Make the figure look a little better: +%! ## - scale and label the axes +%! ## - show gridlines +%! xlim ([0 15]); +%! ylim ([0 15]); +%! xlabel ('Feature 1'); +%! ylabel ('Feature 3'); +%! grid +%! hold Deleted: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_1.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_1.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_1.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -1,94 +0,0 @@ -## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> -## -## This file is part of the fuzzy-logic-toolkit. -## -## The fuzzy-logic-toolkit is free software; you can redistribute it -## and/or modify it under the terms of the GNU General Public License -## as published by the Free Software Foundation; either version 3 of -## the License, or (at your option) any later version. -## -## The fuzzy-logic-toolkit is distributed in the hope that it will be -## useful, but WITHOUT ANY WARRANTY; without even the implied warranty -## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with the fuzzy-logic-toolkit; see the file COPYING. If not, -## see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Script File} {} gustafson_kessel_demo_1 -## Use the Gustafson-Kessel algorithm to classify a small set of unlabeled -## data points and evaluate the quality of the resulting clusters. -## -## The demo: -## @itemize @minus -## @item -## classifies a small set of unlabeled data points using the Gustafson-Kessel -## algorithm into two fuzzy clusters -## @item -## calculates and prints (on standard output) three validity measures: -## the partition coefficient, the partition entropy, and the Xie-Beni -## validity index -## @item -## plots the input points together with the cluster centers -## @end itemize -## -## For a description of the data structures used in the script, see the -## documentation for gustafson_kessel. -## -## @seealso{gustafson_kessel, gustafson_kessel_demo_2, partition_coeff, partition_entropy, xie_beni_index, fcm, fcm_demo_1, fcm_demo_2} -## -## @end deftypefn - -## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering -## Directory: fuzzy-logic-toolkit/inst/ -## Filename: gustafson_kessel_demo_1.m -## Last-Modified: 20 Aug 2012 - -##---------------------------------------------------------------------- -## Note: The input_data is taken from Chapter 13, Example 17 in -## Fuzzy Logic: Intelligence, Control and Information, by J. Yen -## and R. Langari, Prentice Hall, 1999, page 381 (International -## Edition). -##---------------------------------------------------------------------- - -## Use gustafson_kessel to classify the data in matrix x. -input_data = [2 12; 4 9; 7 13; 11 5; 12 7; 14 4] -number_of_clusters = 2 -[cluster_centers, soft_partition, obj_fcn_history] = ... - gustafson_kessel (input_data, number_of_clusters) - -## Calculate and print the three validity measures. -printf ("Partition Coefficient: %f\n", ... - partition_coeff (soft_partition)); -printf ("Partition Entropy (with a = 2): %f\n", ... - partition_entropy (soft_partition, 2)); -printf ("Xie-Beni Index: %f\n\n", ... - xie_beni_index (input_data, cluster_centers, soft_partition)); - -## Plot the data points as small blue x's. -figure ('NumberTitle', 'off', 'Name', 'Gustafson-Kessel Demo 1'); -for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... - 'marker', 'x', 'color', 'b'); - hold on; -endfor - -## Plot the cluster centers as larger red *'s. -for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', ... - 4, 'marker', '*', 'color', 'r'); - hold on; -endfor - -## Make the figure look a little better: -## -- scale and label the axes -## -- show gridlines -xlim ([0 15]); -ylim ([0 15]); -xlabel ('Feature 1'); -ylabel ('Feature 2'); -grid -hold Deleted: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_2.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_2.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_2.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -1,125 +0,0 @@ -## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> -## -## This file is part of the fuzzy-logic-toolkit. -## -## The fuzzy-logic-toolkit is free software; you can redistribute it -## and/or modify it under the terms of the GNU General Public License -## as published by the Free Software Foundation; either version 3 of -## the License, or (at your option) any later version. -## -## The fuzzy-logic-toolkit is distributed in the hope that it will be -## useful, but WITHOUT ANY WARRANTY; without even the implied warranty -## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with the fuzzy-logic-toolkit; see the file COPYING. If not, -## see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Script File} {} gustafson_kessel_demo_2 -## Use the Gustafson-Kessel algorithm to classify three-dimensional unlabeled -## data points and evaluate the quality of the resulting clusters. -## -## The demo: -## @itemize @minus -## @item -## classifies three-dimensional unlabeled data points using the -## Gustafson-Kessel algorithm into three fuzzy clusters -## @item -## calculates and prints (on standard output) three validity measures: -## the partition coefficient, the partition entropy, and the Xie-Beni -## validity index -## @item -## plots the input points together with the cluster centers -## @end itemize -## -## For a description of the data structures used in the script, see the -## documentation for gustafson_kessel. -## -## @seealso{gustafson_kessel, gustafson_kessel_demo_1, partition_coeff, partition_entropy, xie_beni_index, fcm, fcm_demo_1, fcm_demo_2} -## -## @end deftypefn - -## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering -## Directory: fuzzy-logic-toolkit/inst/ -## Filename: gustafson_kessel_demo_2.m -## Last-Modified: 20 Aug 2012 - -##---------------------------------------------------------------------- -## Note: The input_data was selected to form three areas of -## different shapes. -##---------------------------------------------------------------------- - -## Use gustafson_kessel to classify the data in matrix x. -input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; - 3 12 5; 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; - 3 5 11; 4 4 9; 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; - 9 12 13; 9 13 14; 10 9 13; 10 13 12; 11 10 14; 11 12 13; - 12 6 12; 12 7 15; 12 9 15; 14 6 14; 14 8 13] -number_of_clusters = 3 -[cluster_centers, soft_partition, obj_fcn_history] = ... - gustafson_kessel (input_data, number_of_clusters, [1 1 1], ... - [NaN NaN NaN 0]) - -## Calculate and print the three validity measures. -printf ("Partition Coefficient: %f\n", ... - partition_coeff (soft_partition)); -printf ("Partition Entropy (with a = 2): %f\n", ... - partition_entropy (soft_partition, 2)); -printf ("Xie-Beni Index: %f\n\n", ... - xie_beni_index (input_data, cluster_centers, soft_partition)); - -## Plot the data points in two dimensions (using features 1 and 2) -## as small blue x's. -figure ('NumberTitle', 'off', 'Name', 'Gustafson-Kessel Demo 2'); -for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... - 'marker', 'x', 'color', 'b'); - hold on; -endfor - -## Plot the cluster centers in two dimensions (using features 1 and 2) -## as larger red *'s. -for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', ... - 4, 'marker', '*', 'color', 'r'); - hold on; -endfor - -## Make the figure look a little better: -## -- scale and label the axes -## -- show gridlines -xlim ([0 15]); -ylim ([0 15]); -xlabel ('Feature 1'); -ylabel ('Feature 2'); -grid - -## Plot the data points in two dimensions (using features 1 and 3) -## as small blue x's. -figure ('NumberTitle', 'off', 'Name', 'Gustafson-Kessel Demo 2'); -for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 3), 'LineWidth', 2, ... - 'marker', 'x', 'color', 'b'); - hold on; -endfor - -## Plot the cluster centers in two dimensions (using features 1 and 3) -## as larger red *'s. -for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 3), 'LineWidth', ... - 4, 'marker', '*', 'color', 'r'); - hold on; -endfor - -## Make the figure look a little better: -## -- scale and label the axes -## -- show gridlines -xlim ([0 15]); -ylim ([0 15]); -xlabel ('Feature 1'); -ylabel ('Feature 3'); -grid -hold Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_coeff.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_coeff.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_coeff.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -36,7 +36,7 @@ ## For more information about the @var{soft_partition} matrix, please see the ## documentation for function fcm. ## -## @seealso{fcm, fcm_demo_1, fcm_demo_2, gustafson_kessel, gustafson_kessel_demo_1, gustafson_kessel_demo_2, partition_entropy, xie_beni_index} +## @seealso{fcm, gustafson_kessel, partition_entropy, xie_beni_index} ## ## @end deftypefn @@ -44,7 +44,7 @@ ## Keywords: fuzzy-logic-toolkit partition coefficient cluster ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: partition_coeff.m -## Last-Modified: 19 Aug 2012 +## Last-Modified: 26 Aug 2012 ##---------------------------------------------------------------------- ## Note: This function is an implementation of Equation 13.9 (corrected @@ -78,3 +78,77 @@ vpc = (sum (sum (soft_part_sqr))) / columns (soft_partition); endfunction + +##---------------------------------------------------------------------- +## Partition Coefficient Demo #1 +##---------------------------------------------------------------------- + +%!demo +%! ## Use the Fuzzy C-Means and Gustafson-Kessel algorithms to classify +%! ## a small set of unlabeled data points and evaluate the quality +%! ## of the resulting clusters. +%! +%! ## Note: The input_data is taken from Chapter 13, Example 17 in +%! ## Fuzzy Logic: Intelligence, Control and Information, by +%! ## J. Yen and R. Langari, Prentice Hall, 1999, page 381 +%! ## (International Edition). +%! +%! input_data = [2 12; 4 9; 7 13; 11 5; 12 7; 14 4] +%! number_of_clusters = 2 +%! +%! ## Using fcm, classify the input data, print the cluster centers, +%! ## and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! fcm (input_data, number_of_clusters, [NaN NaN NaN 0]); +%! puts ("\nResults using the Fuzzy C-Means algorithm:\n\n"); +%! cluster_centers +%! printf ("partition coefficient: %f\n", ... +%! partition_coeff (soft_partition)); +%! +%! ## Using gustafson_kessel, classify the input data, print the cluster +%! ## centers, and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! gustafson_kessel (input_data, number_of_clusters, [1 1 1], ... +%! [NaN NaN NaN 0]); +%! puts ("\nResults using the Gustafson-Kessel algorithm:\n\n"); +%! cluster_centers +%! printf ("partition coefficient: %f\n\n", ... +%! partition_coeff (soft_partition)); + +##---------------------------------------------------------------------- +## Partition Coefficient Demo #2 +##---------------------------------------------------------------------- + +%!demo +%! ## Use the Fuzzy C-Means and Gustafson-Kessel algorithms to classify +%! ## three-dimensional unlabeled data points and evaluate the quality +%! ## of the resulting clusters. +%! +%! ## Note: The input_data was selected to form three areas of +%! ## different shapes. +%! +%! input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; +%! 3 12 5; 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; +%! 3 5 11; 4 4 9; 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; +%! 9 12 13; 9 13 14; 10 9 13; 10 13 12; 11 10 14; +%! 11 12 13; 12 6 12; 12 7 15; 12 9 15; 14 6 14; 14 8 13] +%! number_of_clusters = 3 +%! +%! ## Using fcm, classify the input data, print the cluster centers, +%! ## and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! fcm (input_data, number_of_clusters, [NaN NaN NaN 0]); +%! puts ("\nResults using the Fuzzy C-Means algorithm:\n\n"); +%! cluster_centers +%! printf ("partition coefficient: %f\n", ... +%! partition_coeff (soft_partition)); +%! +%! ## Using gustafson_kessel, classify the input data, print the cluster +%! ## centers, and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! gustafson_kessel (input_data, number_of_clusters, [1 1 1], ... +%! [NaN NaN NaN 0]); +%! puts ("\nResults using the Gustafson-Kessel algorithm:\n\n"); +%! cluster_centers +%! printf ("partition coefficient: %f\n\n", ... +%! partition_coeff (soft_partition)); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_entropy.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_entropy.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_entropy.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -38,7 +38,7 @@ ## For more information about the @var{soft_partition} matrix, please see the ## documentation for function fcm. ## -## @seealso{fcm, fcm_demo_1, fcm_demo_2, gustafson_kessel, gustafson_kessel_demo_1, gustafson_kessel_demo_2, partition_coeff, xie_beni_index} +## @seealso{fcm, gustafson_kessel, partition_coeff, xie_beni_index} ## ## @end deftypefn @@ -46,7 +46,7 @@ ## Keywords: fuzzy-logic-toolkit partition entropy cluster ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: partition_entropy.m -## Last-Modified: 19 Aug 2012 +## Last-Modified: 26 Aug 2012 ##---------------------------------------------------------------------- ## Note: This function is an implementation of Equation 13.10 in @@ -86,3 +86,77 @@ vpe = -(sum (sum (Mu .* log_a_Mu))) / n; endfunction + +##---------------------------------------------------------------------- +## Partition Entropy Demo #1 +##---------------------------------------------------------------------- + +%!demo +%! ## Use the Fuzzy C-Means and Gustafson-Kessel algorithms to classify +%! ## a small set of unlabeled data points and evaluate the quality +%! ## of the resulting clusters. +%! +%! ## Note: The input_data is taken from Chapter 13, Example 17 in +%! ## Fuzzy Logic: Intelligence, Control and Information, by +%! ## J. Yen and R. Langari, Prentice Hall, 1999, page 381 +%! ## (International Edition). +%! +%! input_data = [2 12; 4 9; 7 13; 11 5; 12 7; 14 4] +%! number_of_clusters = 2 +%! +%! ## Using fcm, classify the input data, print the cluster centers, +%! ## and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! fcm (input_data, number_of_clusters, [NaN NaN NaN 0]); +%! puts ("\nResults using the Fuzzy C-Means algorithm:\n\n"); +%! cluster_centers +%! printf ("partition entropy (with a = 2): %f\n", ... +%! partition_entropy (soft_partition, 2)); +%! +%! ## Using gustafson_kessel, classify the input data, print the cluster +%! ## centers, and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! gustafson_kessel (input_data, number_of_clusters, [1 1 1], ... +%! [NaN NaN NaN 0]); +%! puts ("\nResults using the Gustafson-Kessel algorithm:\n\n"); +%! cluster_centers +%! printf ("partition entropy (with a = 2): %f\n\n", ... +%! partition_entropy (soft_partition, 2)); + +##---------------------------------------------------------------------- +## Partition Entropy Demo #2 +##---------------------------------------------------------------------- + +%!demo +%! ## Use the Fuzzy C-Means and Gustafson-Kessel algorithms to classify +%! ## three-dimensional unlabeled data points and evaluate the quality +%! ## of the resulting clusters. +%! +%! ## Note: The input_data was selected to form three areas of +%! ## different shapes. +%! +%! input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; +%! 3 12 5; 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; +%! 3 5 11; 4 4 9; 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; +%! 9 12 13; 9 13 14; 10 9 13; 10 13 12; 11 10 14; +%! 11 12 13; 12 6 12; 12 7 15; 12 9 15; 14 6 14; 14 8 13] +%! number_of_clusters = 3 +%! +%! ## Using fcm, classify the input data, print the cluster centers, +%! ## and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! fcm (input_data, number_of_clusters, [NaN NaN NaN 0]); +%! puts ("\nResults using the Fuzzy C-Means algorithm:\n\n"); +%! cluster_centers +%! printf ("partition entropy (with a = 2): %f\n", ... +%! partition_entropy (soft_partition, 2)); +%! +%! ## Using gustafson_kessel, classify the input data, print the cluster +%! ## centers, and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! gustafson_kessel (input_data, number_of_clusters, [1 1 1], ... +%! [NaN NaN NaN 0]); +%! puts ("\nResults using the Gustafson-Kessel algorithm:\n\n"); +%! cluster_centers +%! printf ("partition entropy (with a = 2): %f\n\n", ... +%! partition_entropy (soft_partition, 2)); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/xie_beni_index.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/xie_beni_index.m 2012-08-25 08:27:39 UTC (rev 10914) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/xie_beni_index.m 2012-08-26 14:54:12 UTC (rev 10915) @@ -41,7 +41,7 @@ ## and @var{soft_partition} matrices, please see the documentation for function ## fcm. ## -## @seealso{fcm, fcm_demo_1, fcm_demo_2, gustafson_kessel, gustafson_kessel_demo_1, gustafson_kessel_demo_2, partition_coeff, partition_entropy} +## @seealso{fcm, gustafson_kessel, partition_coeff, partition_entropy} ## ## @end deftypefn @@ -49,7 +49,7 @@ ## Keywords: fuzzy-logic-toolkit fuzzy xie beni cluster validity ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: xie_beni_index.m -## Last-Modified: 19 Aug 2012 +## Last-Modified: 26 Aug 2012 function vxb = xie_beni_index (input_data, cluster_centers, ... soft_partition) @@ -126,3 +126,77 @@ d_sqr_min = min (min (d_sqr_matrix)); endfunction + +##---------------------------------------------------------------------- +## Xie-Beni Index Demo #1 +##---------------------------------------------------------------------- + +%!demo +%! ## Use the Fuzzy C-Means and Gustafson-Kessel algorithms to classify +%! ## a small set of unlabeled data points and evaluate the quality +%! ## of the resulting clusters. +%! +%! ## Note: The input_data is taken from Chapter 13, Example 17 in +%! ## Fuzzy Logic: Intelligence, Control and Information, by +%! ## J. Yen and R. Langari, Prentice Hall, 1999, page 381 +%! ## (International Edition). +%! +%! input_data = [2 12; 4 9; 7 13; 11 5; 12 7; 14 4] +%! number_of_clusters = 2 +%! +%! ## Using fcm, classify the input data, print the cluster centers, +%! ## and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! fcm (input_data, number_of_clusters, [NaN NaN NaN 0]); +%! puts ("\nResults using the Fuzzy C-Means algorithm:\n\n"); +%! cluster_centers +%! printf ("Xie-Beni index: %f\n", ... +%! xie_beni_index (input_data, cluster_centers, soft_partition)); +%! +%! ## Using gustafson_kessel, classify the input data, print the cluster +%! ## centers, and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! gustafson_kessel (input_data, number_of_clusters, [1 1 1], ... +%! [NaN NaN NaN 0]); +%! puts ("\nResults using the Gustafson-Kessel algorithm:\n\n"); +%! cluster_centers +%! printf ("Xie-Beni index: %f\n\n", ... +%! xie_beni_index (input_data, cluster_centers, soft_partition)); + +##---------------------------------------------------------------------- +## Xie-Beni Index Demo #2 +##---------------------------------------------------------------------- + +%!demo +%! ## Use the Fuzzy C-Means and Gustafson-Kessel algorithms to classify +%! ## three-dimensional unlabeled data points and evaluate the quality +%! ## of the resulting clusters. +%! +%! ## Note: The input_data was selected to form three areas of +%! ## different shapes. +%! +%! input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; +%! 3 12 5; 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; +%! 3 5 11; 4 4 9; 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; +%! 9 12 13; 9 13 14; 10 9 13; 10 13 12; 11 10 14; +%! 11 12 13; 12 6 12; 12 7 15; 12 9 15; 14 6 14; 14 8 13] +%! number_of_clusters = 3 +%! +%! ## Using fcm, classify the input data, print the cluster centers, +%! ## and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! fcm (input_data, number_of_clusters, [NaN NaN NaN 0]); +%! puts ("\nResults using the Fuzzy C-Means algorithm:\n\n"); +%! cluster_centers +%! printf ("Xie-Beni index: %f\n", ... +%! xie_beni_index (input_data, cluster_centers, soft_partition)); +%! +%! ## Using gustafson_kessel, classify the input data, print the cluster +%! ## centers, and calculate and print the partition coefficient. +%! [cluster_centers, soft_partition, obj_fcn_history] = ... +%! gustafson_kessel (input_data, number_of_clusters, [1 1 1], ... +%! [NaN NaN NaN 0]); +%! puts ("\nResults using the Gustafson-Kessel algorithm:\n\n"); +%! cluster_centers +%! printf ("Xie-Beni index: %f\n\n", ... +%! xie_beni_index (input_data, cluster_centers, soft_partition)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpi...@us...> - 2012-08-25 08:27:46
|
Revision: 10914 http://octave.svn.sourceforge.net/octave/?rev=10914&view=rev Author: jpicarbajal Date: 2012-08-25 08:27:39 +0000 (Sat, 25 Aug 2012) Log Message: ----------- mechanics: improving PKG_* scripts Modified Paths: -------------- trunk/octave-forge/main/mechanics/PKG_ADD trunk/octave-forge/main/mechanics/PKG_DEL Modified: trunk/octave-forge/main/mechanics/PKG_ADD =================================================================== --- trunk/octave-forge/main/mechanics/PKG_ADD 2012-08-25 06:15:01 UTC (rev 10913) +++ trunk/octave-forge/main/mechanics/PKG_ADD 2012-08-25 08:27:39 UTC (rev 10914) @@ -1,7 +1,51 @@ %1 dirlist = {"molecularDynamics", "ocframe", "core"}; dirname = fileparts (canonicalize_file_name (mfilename ("fullpath"))); +pp = strsplit (dirname,filesep (), true); +arch = cstrcat (octave_config_info ("canonical_host_type"), + "-", octave_config_info ("api_version")); +%% Get the correct path +% Search installed packages +[local_packages, global_packages] = pkg("list"); +installed_pkgs_lst = {local_packages{:}, global_packages{:}}; +pkg_data = installed_pkgs_lst (cellfun(@(x) ismember (x.name, {"mechanics"}), ... + installed_pkgs_lst, "unif", true)); + +if isempty(pkg_data) + % The package is not installed yet + [pkg_folder dep_folder] = pkg ("prefix"); + pkg_folder = [pkg_folder strcat(filesep(),{pp{end-1:end}}){:} ]; + if strcmp (arch , pp{end}) + %% If we are in Architecture dependent folder add from outside + pkg_folder = strsplit (pkg_folder,filesep (), true); + pkg_folder = [strcat(filesep(),{pkg_folder{1:end-1}}){:}]; + end +else + pkg_folder = pkg_data{1}.dir; +end + +if (! exist (fullfile (dirname, "inst"), "dir")) +%% Installing + for ii=1:length (dirlist) + addpath ( [ pkg_folder filesep() dirlist{ii}],"-end") + endfor + +else +%% Testing + warning("mechanics:Devel","Adding path for testing."); + for ii=1:length(dirlist) + addpath ([ dirname "/inst/" dirlist{ii}]) + endfor +endif + +warning('off', 'Octave:fopen-file-in-path'); +clear dirlist dirname pp arch pkg_folder +clear global_packages ii installed_pkgs_lst local_packages pkg_data + +%{ +dirname = fileparts (canonicalize_file_name (mfilename ("fullpath"))); + %% If we are in Architecture dependent folder add from outside arch = cstrcat (octave_config_info ("canonical_host_type"), "-", octave_config_info ("api_version")); @@ -23,3 +67,4 @@ warning('off', 'Octave:fopen-file-in-path'); clear dirlist dirname pp +%} Modified: trunk/octave-forge/main/mechanics/PKG_DEL =================================================================== --- trunk/octave-forge/main/mechanics/PKG_DEL 2012-08-25 06:15:01 UTC (rev 10913) +++ trunk/octave-forge/main/mechanics/PKG_DEL 2012-08-25 08:27:39 UTC (rev 10914) @@ -1,7 +1,46 @@ %1 dirlist = {"molecularDynamics", "ocframe", "core"}; dirname = fileparts (canonicalize_file_name (mfilename ("fullpath"))); +pp = strsplit (dirname,filesep (), true); +arch = cstrcat (octave_config_info ("canonical_host_type"), + "-", octave_config_info ("api_version")); +%% Get the correct path +% Search installed packages +[local_packages, global_packages] = pkg("list"); +installed_pkgs_lst = {local_packages{:}, global_packages{:}}; +pkg_data = installed_pkgs_lst (cellfun(@(x) ismember (x.name, {"mechanics"}), ... + installed_pkgs_lst, "unif", true)); +if isempty(pkg_data) + % The package is not installed yet + [pkg_folder dep_folder] = pkg ("prefix"); + pkg_folder = [pkg_folder strcat(filesep(),{pp{end-1:end}}){:} ]; + if strcmp (arch , pp{end}) + %% If we are in Architecture dependent folder add from outside + pkg_folder = strsplit (pkg_folder,filesep (), true); + pkg_folder = [strcat(filesep(),{pkg_folder{1:end-1}}){:}]; + end +else + pkg_folder = pkg_data{1}.dir; +end +if (! exist (fullfile (dirname, "inst"), "dir")) +## Run this if the package is installed + for ii=1:length (dirlist) + rmpath ( [ pkg_folder filesep() dirlist{ii}]) + endfor +else + warning("mechanics:Devel","Removing path for testing."); + for ii=1:length(dirlist) + rmpath ([ dirname "/inst/" dirlist{ii}]) + endfor +endif + +clear dirlist dirname pp arch pkg_folder + +%{ +dirlist = {"molecularDynamics", "ocframe", "core"}; +dirname = fileparts (canonicalize_file_name (mfilename ("fullpath"))); + %% If we are not in Architecture dependent folder arch = cstrcat (octave_config_info ("canonical_host_type"), "-", octave_config_info ("api_version")); @@ -23,3 +62,4 @@ endif clear dirlist dirname pp +%} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-25 06:15:07
|
Revision: 10913 http://octave.svn.sourceforge.net/octave/?rev=10913&view=rev Author: paramaniac Date: 2012-08-25 06:15:01 +0000 (Sat, 25 Aug 2012) Log Message: ----------- control: fix tex warning by replacing \ by \\ Modified Paths: -------------- trunk/octave-forge/main/control/inst/ctrbf.m trunk/octave-forge/main/control/inst/obsvf.m Modified: trunk/octave-forge/main/control/inst/ctrbf.m =================================================================== --- trunk/octave-forge/main/control/inst/ctrbf.m 2012-08-25 05:44:24 UTC (rev 10912) +++ trunk/octave-forge/main/control/inst/ctrbf.m 2012-08-25 06:15:01 UTC (rev 10913) @@ -27,7 +27,7 @@ ## ## @example ## @group -## Abar = Tc \ A * Tc , Bbar = Tc \ B , Cbar = C * Tc +## Abar = Tc \\ A * Tc , Bbar = Tc \\ B , Cbar = C * Tc ## @end group ## @end example ## Modified: trunk/octave-forge/main/control/inst/obsvf.m =================================================================== --- trunk/octave-forge/main/control/inst/obsvf.m 2012-08-25 05:44:24 UTC (rev 10912) +++ trunk/octave-forge/main/control/inst/obsvf.m 2012-08-25 06:15:01 UTC (rev 10913) @@ -27,7 +27,7 @@ ## ## @example ## @group -## Abar = To \ A * To , Bbar = To \ B , Cbar = C * To +## Abar = To \\ A * To , Bbar = To \\ B , Cbar = C * To ## @end group ## @end example ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-25 05:44:30
|
Revision: 10912 http://octave.svn.sourceforge.net/octave/?rev=10912&view=rev Author: paramaniac Date: 2012-08-25 05:44:24 +0000 (Sat, 25 Aug 2012) Log Message: ----------- control: doc enhancements Modified Paths: -------------- trunk/octave-forge/main/control/inst/margin.m trunk/octave-forge/main/control/inst/sensitivity.m Modified: trunk/octave-forge/main/control/inst/margin.m =================================================================== --- trunk/octave-forge/main/control/inst/margin.m 2012-08-24 16:27:38 UTC (rev 10911) +++ trunk/octave-forge/main/control/inst/margin.m 2012-08-25 05:44:24 UTC (rev 10912) @@ -18,9 +18,11 @@ ## -*- texinfo -*- ## @deftypefn{Function File} {[@var{gamma}, @var{phi}, @var{w_gamma}, @var{w_phi}] =} margin (@var{sys}) ## @deftypefnx{Function File} {[@var{gamma}, @var{phi}, @var{w_gamma}, @var{w_phi}] =} margin (@var{sys}, @var{tol}) -## Gain and phase margin of a system. If no output arguments are given, both gain and phase margin -## are plotted on a bode diagram. Otherwise, the margins and their corresponding frequencies are -## computed and returned. +## Gain and phase margin of a system. +## If no output arguments are given, both gain and phase margin are plotted on a bode diagram. +## Otherwise, the margins and their corresponding frequencies are computed and returned. +## A more robust criterion to assess the stability of a feedback system is the sensitivity Ms +## computed by command @command{sensitivity}. ## ## @strong{Inputs} ## @table @var Modified: trunk/octave-forge/main/control/inst/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-24 16:27:38 UTC (rev 10911) +++ trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-25 05:44:24 UTC (rev 10912) @@ -37,7 +37,10 @@ ## ## @end ifnottex ## If no output arguments are given, the critical distance 1/Ms -## is plotted on a Nyquist diagram. +## is plotted on a Nyquist diagram. +## In contrast to gain and phase margin as computed by command +## @command{margin}, the sensitivity @var{Ms} is a more robust +## criterion to assess the stability of a feedback system. ## ## @strong{Inputs} ## @table @var This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-24 16:27:49
|
Revision: 10911 http://octave.svn.sourceforge.net/octave/?rev=10911&view=rev Author: paramaniac Date: 2012-08-24 16:27:38 +0000 (Fri, 24 Aug 2012) Log Message: ----------- control: add some checks Modified Paths: -------------- trunk/octave-forge/main/control/inst/sensitivity.m Modified: trunk/octave-forge/main/control/inst/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-24 16:13:36 UTC (rev 10910) +++ trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-24 16:27:38 UTC (rev 10911) @@ -87,11 +87,6 @@ function [ret, ws] = sensitivity (G, varargin) - ## TODO: show nyquist diagram of L with circle - ## center (-1, 0) and radius equal to the - ## shortest distance 1/Ms, frequency w is - ## [Ms, w] = norm (S, inf) - if (nargin == 0) print_usage (); elseif (nargin == 1) # L := G @@ -111,9 +106,13 @@ if (length (Ms) > 1) error ("sensitivity: plotting only works for a single controller"); endif + if (! issiso (L)) + error ("sensitivity: Nyquist plot requires SISO systems"); + endif if (iscell (L)) L = L{1}; endif + [H, w] = __frequency_response__ (L, [], false, 0, "ext"); H = H(:); re = real (H); @@ -121,6 +120,7 @@ Hs = freqresp (L, ws); res = real (Hs); ims = imag (Hs); + plot (re, im, "b", [-1, res], [0, ims], "r") axis ("equal") xlim (__axis_margin__ (xlim)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lm...@us...> - 2012-08-24 16:13:42
|
Revision: 10910 http://octave.svn.sourceforge.net/octave/?rev=10910&view=rev Author: lmarkov Date: 2012-08-24 16:13:36 +0000 (Fri, 24 Aug 2012) Log Message: ----------- M fuzzy-logic-toolkit/DESCRIPTION M fuzzy-logic-toolkit/ChangeLog Modified Paths: -------------- trunk/octave-forge/main/fuzzy-logic-toolkit/ChangeLog trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/ChangeLog =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/ChangeLog 2012-08-24 16:13:07 UTC (rev 10909) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/ChangeLog 2012-08-24 16:13:36 UTC (rev 10910) @@ -1,3 +1,12 @@ +2012-08-22 L. Markowsky <lm...@us...> + + * Version 0.4.1 released. + * ChangeLog: Updated file. + * DESCRIPTION: Updated file. + * inst/*.m: Many trivial changes to line length and copyright notices. + * inst/private/*.m: Many trivial changes to line length and copyright notice. + * All demos tested under: Fedora 16/Octave 3.4.3 + 2012-07-10 L. Markowsky <lm...@us...> * Version 0.4.0 released. Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION 2012-08-24 16:13:07 UTC (rev 10909) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/DESCRIPTION 2012-08-24 16:13:36 UTC (rev 10910) @@ -1,6 +1,6 @@ Name: fuzzy-logic-toolkit -Version: 0.4.0 -Date: 2012-07-10 +Version: 0.4.1 +Date: 2012-08-22 Author: L. Markowsky <lm...@us...> Maintainer: L. Markowsky <lm...@us...> Title: Octave Fuzzy Logic Toolkit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lm...@us...> - 2012-08-24 16:13:17
|
Revision: 10909 http://octave.svn.sourceforge.net/octave/?rev=10909&view=rev Author: lmarkov Date: 2012-08-24 16:13:07 +0000 (Fri, 24 Aug 2012) Log Message: ----------- M inst/getfis.m M inst/psigmf.m M inst/smf.m M inst/rmvar.m M inst/partition_entropy.m M inst/trapmf.m M inst/bounded_difference.m M inst/newfis.m M inst/pimf.m M inst/zmf.m M inst/hamacher_sum.m M inst/setfis.m M inst/plotmf.m M inst/rmmf.m M inst/einstein_sum.m M inst/gustafson_kessel_demo_1.m M inst/gustafson_kessel_demo_2.m M inst/defuzz.m M inst/gbellmf.m M inst/gensurf.m M inst/algebraic_product.m M inst/xie_beni_index.m M inst/evalmf.m M inst/partition_coeff.m M inst/gustafson_kessel.m M inst/sugeno_tip_demo.m M inst/trimf.m M inst/cubic_approx_demo.m M inst/showfis.m M inst/heart_disease_demo_1.m M inst/heart_disease_demo_2.m M inst/mamdani_tip_demo.m M inst/gauss2mf.m M inst/drastic_product.m M inst/fcm_demo_1.m M inst/evalfis.m M inst/fcm_demo_2.m M inst/linear_tip_demo.m M inst/writefis.m M inst/algebraic_sum.m M inst/investment_portfolio_demo.m M inst/addvar.m M inst/bounded_sum.m M inst/gaussmf.m M inst/fcm.m M inst/sigmf.m M inst/hamacher_product.m M inst/showrule.m M inst/dsigmf.m M inst/addmf.m M inst/drastic_sum.m M inst/readfis.m M inst/einstein_product.m M inst/addrule.m Modified Paths: -------------- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addrule.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addvar.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/algebraic_product.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/algebraic_sum.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/bounded_difference.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/bounded_sum.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/cubic_approx_demo.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/defuzz.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/drastic_product.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/drastic_sum.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/dsigmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/einstein_product.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/einstein_sum.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/evalfis.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/evalmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_1.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_2.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gauss2mf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gaussmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gbellmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gensurf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/getfis.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_1.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gustafson_kessel_demo_2.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/hamacher_product.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/hamacher_sum.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/heart_disease_demo_1.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/heart_disease_demo_2.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/investment_portfolio_demo.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/linear_tip_demo.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/mamdani_tip_demo.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/newfis.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_coeff.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/partition_entropy.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/pimf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/plotmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/psigmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/readfis.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/rmmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/rmvar.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/setfis.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/showfis.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/showrule.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/sigmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/smf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/sugeno_tip_demo.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/trapmf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/trimf.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/writefis.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/xie_beni_index.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/zmf.m Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addmf.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addmf.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addmf.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -59,17 +59,18 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy membership-function membership +## Keywords: fuzzy-logic-toolkit fuzzy membership ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: addmf.m ## Note: The demo code is based on an assignment written by ## Dr. Bruce Segee (University of Maine Dept. of ECE). -## Last-Modified: 28 Oct 2011 +## Last-Modified: 18 Aug 2012 -function fis = addmf (fis, in_or_out, var_index, mf_name, mf_type, mf_params) +function fis = addmf (fis, in_or_out, var_index, mf_name, mf_type, ... + mf_params) - ## If the caller did not supply 6 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 6 argument values with the correct + ## types, print an error message and halt. if (nargin != 6) puts ("Type 'help addmf' for more information.\n"); @@ -92,9 +93,11 @@ error ("addmf's sixth argument must be a vector of parameters\n"); endif - ## Create a new membership function struct and update the FIS structure. + ## Create a new membership function struct and update the + ## FIS structure. - new_mf = struct ('name', mf_name, 'type', mf_type, 'params', mf_params); + new_mf = struct ('name', mf_name, 'type', mf_type, 'params', ... + mf_params); if (strcmp (tolower (in_or_out), 'input')) if (length (fis.input(var_index).mf) == 0) fis.input(var_index).mf = new_mf; @@ -119,9 +122,12 @@ %! ## Add two inputs and their membership functions. %! a = addvar (a, 'input', 'LDL-Level', [0 300]); %! a = addmf (a, 'input', 1, 'Low', 'trapmf', [-1 0 90 110]); -%! a = addmf (a, 'input', 1, 'Low-Borderline', 'trapmf', [90 110 120 140]); -%! a = addmf (a, 'input', 1, 'Borderline', 'trapmf', [120 140 150 170]); -%! a = addmf (a, 'input', 1, 'High-Borderline', 'trapmf', [150 170 180 200]); +%! a = addmf (a, 'input', 1, 'Low-Borderline', 'trapmf', ... +%! [90 110 120 140]); +%! a = addmf (a, 'input', 1, 'Borderline', 'trapmf', ... +%! [120 140 150 170]); +%! a = addmf (a, 'input', 1, 'High-Borderline', 'trapmf', ... +%! [150 170 180 200]); %! a = addmf (a, 'input', 1, 'High', 'trapmf', [180 200 300 301]); %! %! a = addvar (a, 'input', 'HDL-Level', [0 100]); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addrule.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addrule.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addrule.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -84,12 +84,12 @@ ## Keywords: fuzzy-logic-toolkit fuzzy rule ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: addrule.m -## Last-Modified: 11 Nov 2011 +## Last-Modified: 18 Aug 2012 function fis = addrule (fis, rule_matrix) - ## If the caller did not supply 2 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 2 argument values with the correct + ## types, print an error message and halt. if (nargin != 2) puts ("Type 'help addrule' for more information.\n"); @@ -98,19 +98,20 @@ puts ("Type 'help addrule' for more information.\n"); error ("addrule's first argument must be an FIS structure\n"); elseif (!is_real_matrix (rule_matrix)) - puts ("Type 'help addrule' for more information.\n"); - error ("addrule's second argument must be a matrix of real numbers\n"); + puts ("Type 'help addrule' for more information. addrule's \n"); + error ("second argument must be a matrix of real numbers\n"); endif - ## For each row in the rule_matrix, create a new rule struct and update - ## the FIS structure. + ## For each row in the rule_matrix, create a new rule struct and + ## update the FIS structure. num_inputs = columns (fis.input); num_outputs = columns (fis.output); for i = 1 : rows (rule_matrix) antecedent = rule_matrix(i, 1 : num_inputs); - consequent = rule_matrix(i, (num_inputs+1) : (num_inputs+num_outputs)); + consequent = rule_matrix(i, ... + (num_inputs+1) : (num_inputs+num_outputs)); weight = rule_matrix(i, num_inputs + num_outputs + 1); connection = rule_matrix(i, num_inputs + num_outputs + 2); new_rules(i) = struct ('antecedent', antecedent, ... Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addvar.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addvar.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/addvar.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -46,12 +46,12 @@ ## Keywords: fuzzy-logic-toolkit fuzzy variable ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: addvar.m -## Last-Modified: 28 Oct 2011 +## Last-Modified: 18 Aug 2012 function fis = addvar (fis, in_or_out, var_name, var_range) - ## If the caller did not supply 4 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 4 argument values with the correct + ## types, print an error message and halt. if (nargin != 4) puts ("Type 'help addvar' for more information.\n"); @@ -74,7 +74,8 @@ ## Create a new variable struct and update the FIS input or output ## variable list. - new_variable = struct ('name', var_name, 'range', var_range, 'mf', []); + new_variable = struct ('name', var_name, 'range', var_range, ... + 'mf', []); if (strcmp (tolower (in_or_out), 'input')) if (length (fis.input) == 0) fis.input = new_variable; Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/algebraic_product.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/algebraic_product.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/algebraic_product.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -37,14 +37,17 @@ ## Keywords: fuzzy-logic-toolkit fuzzy algebraic_product ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: algebraic_product.m -## Last-Modified: 12 Nov 2011 +## Last-Modified: 18 Aug 2012 function retval = algebraic_product (x, y = 0) if (!(isreal (x) && isreal (y))) + puts ("Arguments to algebraic_product must be real scalars "); + puts ("or matrices.\n"); puts ("Type 'help algebraic_product' for more information.\n"); - error ("algebraic_product requires real scalar or matrix arguments\n"); + error ("invalid arguments to function algebraic_product\n"); elseif (nargin == 2 && ... - (isscalar (x) || isscalar (y) || isequal (size (x), size (y)))) + (isscalar (x) || isscalar (y) || ... + isequal (size (x), size (y)))) retval = x .* y; elseif (nargin == 1 && ndims (x) <= 2) retval = prod (x); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/algebraic_sum.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/algebraic_sum.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/algebraic_sum.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -37,14 +37,15 @@ ## Keywords: fuzzy-logic-toolkit fuzzy algebraic_sum ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: algebraic_sum.m -## Last-Modified: 12 Nov 2011 +## Last-Modified: 18 Aug 2012 function retval = algebraic_sum (x, y = 0) if (!(isreal (x) && isreal (y))) puts ("Type 'help algebraic_sum' for more information.\n"); error ("algebraic_sum requires real scalar or matrix arguments\n"); elseif (nargin == 2 && ... - (isscalar (x) || isscalar (y) || isequal (size (x), size (y)))) + (isscalar (x) || isscalar (y) || ... + isequal (size (x), size (y)))) retval = x .+ y .- x .* y; elseif (nargin == 1 && isvector (x)) retval = algebraic_sum_of_vector (x); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/bounded_difference.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/bounded_difference.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/bounded_difference.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -38,14 +38,17 @@ ## Keywords: fuzzy-logic-toolkit fuzzy bounded_difference ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: bounded_difference.m -## Last-Modified: 12 Nov 2011 +## Last-Modified: 18 Aug 2012 function retval = bounded_difference (x, y = 0) if (!(isreal (x) && isreal (y))) + puts ("Function 'bounded_difference' requires real scalar "); + puts ("or matrix arguments.\n"); puts ("Type 'help bounded_difference' for more information.\n"); - error ("bounded_difference requires real scalar or matrix arguments\n"); + error ("invalid arguments to function bounded_difference\n"); elseif (nargin == 2 && ... - (isscalar (x) || isscalar (y) || isequal (size (x), size (y)))) + (isscalar (x) || isscalar (y) || ... + isequal (size (x), size (y)))) retval = max (0, (x .+ y - 1)); elseif (nargin == 1 && isvector (x)) retval = bounded_difference_of_vector (x); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/bounded_sum.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/bounded_sum.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/bounded_sum.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -37,14 +37,15 @@ ## Keywords: fuzzy-logic-toolkit fuzzy bounded_sum ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: bounded_sum.m -## Last-Modified: 12 Nov 2011 +## Last-Modified: 18 Aug 2012 function retval = bounded_sum (x, y = 0) if (!(isreal (x) && isreal (y))) puts ("Type 'help bounded_sum' for more information.\n"); error ("bounded_sum requires real scalar or matrix arguments\n"); elseif (nargin == 2 && ... - (isscalar (x) || isscalar (y) || isequal (size (x), size (y)))) + (isscalar (x) || isscalar (y) || ... + isequal (size (x), size (y)))) retval = min (1, (x .+ y)); elseif (nargin == 1 && isvector (x)) retval = bounded_sum_of_vector (x); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/cubic_approx_demo.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/cubic_approx_demo.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/cubic_approx_demo.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/defuzz.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/defuzz.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/defuzz.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -53,14 +53,14 @@ ## Keywords: fuzzy-logic-toolkit fuzzy defuzzification ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: defuzz.m -## Last-Modified: 16 Jul 2011 +## Last-Modified: 18 Aug 2012 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- function crisp_x = defuzz (x, y, defuzz_method) - ## If the caller did not supply 3 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 3 argument values with the correct + ## types, print an error message and halt. if (nargin != 3) puts ("Type 'help defuzz' for more information.\n"); @@ -70,31 +70,31 @@ error ("defuzz's first argument must be a valid domain\n"); elseif (!(isvector (y) && isreal (y) && length (x) == length (y))) puts ("Type 'help defuzz' for more information.\n"); - error ("defuzz's second argument must be a real number or vector\n"); + error ("defuzz's 2nd argument must be a real number or vector\n"); elseif (!is_string (defuzz_method)) puts ("Type 'help defuzz' for more information.\n"); error ("defuzz's third argument must be a string\n"); endif - ## Calculate and return the defuzzified (crisp_x) value using the method - ## specified by the argument defuzz_method. + ## Calculate and return the defuzzified (crisp_x) value using the + ## method specified by the argument defuzz_method. crisp_x = str2func (defuzz_method) (x, y); endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: crisp_x = centroid (x, y) ## crisp_x = centroid ([x1 x2 ... xn], [y1 y2 ... yn]) ## ## For a given domain (x or [x1 x2 ... xn]) and corresponding y-values -## (y or [y1 y2 ... yn]), return the x-value of the centroid of the region -## described by the points (xi, yi). +## (y or [y1 y2 ... yn]), return the x-value of the centroid of the +## region described by the points (xi, yi). ## ## Both arguments are assumed to be reals or non-empty vectors of reals. -## In addition, x is assumed to be strictly increasing, and x and y are assumed -## to be of equal length. -##------------------------------------------------------------------------------ +## In addition, x is assumed to be strictly increasing, and x and y are +## assumed to be of equal length. +##---------------------------------------------------------------------- function crisp_x = centroid (x, y) @@ -102,7 +102,7 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: crisp_x = bisector (x, y) ## crisp_x = bisector ([x1 x2 ... xn], [y1 y2 ... yn]) ## @@ -111,15 +111,15 @@ ## described by the points (xi, yi). ## ## Both arguments are assumed to be reals or non-empty vectors of reals. -## In addition, x is assumed to be strictly increasing, and x and y are assumed -## to be of equal length. -##------------------------------------------------------------------------------ +## In addition, x is assumed to be strictly increasing, and x and y are +## assumed to be of equal length. +##---------------------------------------------------------------------- function crisp_x = bisector (x, y) - ## Find the bisector using a binary search. To ensure that the function - ## terminates, add a counter to limit the iterations to the length of the - ## vectors x and y. + ## Find the bisector using a binary search. To ensure that the + ## function terminates, add a counter to limit the iterations to the + ## length of the vectors x and y. half_area = trapz (x, y) / 2; x_len = length (x); @@ -145,18 +145,19 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: crisp_x = mom (x, y) ## crisp_x = mom ([x1 x2 ... xn], [y1 y2 ... yn]) ## ## For a given domain (x or [x1 x2 ... xn]) and corresponding y-values -## (y or [y1 y2 ... yn]), return the "Mean of Maximum"; that is, return the -## average of the x-values corresponding to the maximum y-value in y. +## (y or [y1 y2 ... yn]), return the "Mean of Maximum"; that is, return +## the average of the x-values corresponding to the maximum y-value +## in y. ## ## Both arguments are assumed to be reals or non-empty vectors of reals. -## In addition, x is assumed to be strictly increasing, and x and y are assumed -## to be of equal length. -##------------------------------------------------------------------------------ +## In addition, x is assumed to be strictly increasing, and x and y are +## assumed to be of equal length. +##---------------------------------------------------------------------- function crisp_x = mom (x, y) @@ -167,18 +168,19 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: crisp_x = som (x, y) ## crisp_x = som ([x1 x2 ... xn], [y1 y2 ... yn]) ## ## For a given domain (x or [x1 x2 ... xn]) and corresponding y-values -## (y or [y1 y2 ... yn]), return the "Smallest of Maximum"; that is, return the -## smallest x-value corresponding to the maximum y-value in y. +## (y or [y1 y2 ... yn]), return the "Smallest of Maximum"; that is, +## return the smallest x-value corresponding to the maximum y-value +## in y. ## ## Both arguments are assumed to be reals or non-empty vectors of reals. -## In addition, x is assumed to be strictly increasing, and x and y are assumed -## to be of equal length. -##------------------------------------------------------------------------------ +## In addition, x is assumed to be strictly increasing, and x and y are +## assumed to be of equal length. +##---------------------------------------------------------------------- function crisp_x = som (x, y) @@ -189,18 +191,18 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: crisp_x = lom (x, y) ## crisp_x = lom ([x1 x2 ... xn], [y1 y2 ... yn]) ## ## For a given domain (x or [x1 x2 ... xn]) and corresponding y-values -## (y or [y1 y2 ... yn]), return the "Largest of Maximum"; that is, return the -## largest x-value corresponding to the maximum y-value in y. +## (y or [y1 y2 ... yn]), return the "Largest of Maximum"; that is, +## return the largest x-value corresponding to the maximum y-value in y. ## ## Both arguments are assumed to be reals or non-empty vectors of reals. -## In addition, x is assumed to be strictly increasing, and x and y are assumed -## to be of equal length. -##------------------------------------------------------------------------------ +## In addition, x is assumed to be strictly increasing, and x and y are +## assumed to be of equal length. +##---------------------------------------------------------------------- function crisp_x = lom (x, y) @@ -211,17 +213,17 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: retval = wtaver (values, weights) ## -## Return the weighted average of the values. The parameters are assumed to be -## equal-length vectors of real numbers. +## Return the weighted average of the values. The parameters are assumed +## to be equal-length vectors of real numbers. ## ## Examples: ## wtaver ([1 2 3 4], [1 1 1 1]) ==> 2.5 ## wtaver ([1 2 3 4], [1 2 3 4]) ==> 3 ## wtaver ([1 2 3 4], [0 0 1 1]) ==> 3.5 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- function retval = wtaver (values, weights) @@ -229,17 +231,17 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: retval = wtsum (values, weights) ## -## Return the weighted sum of the values. The parameters are assumed to be -## equal-length vectors of real numbers. +## Return the weighted sum of the values. The parameters are assumed to +## be equal-length vectors of real numbers. ## ## Examples: ## wtsum ([1 2 3 4], [1 1 1 1]) ==> 10 ## wtsum ([1 2 3 4], [1 2 3 4]) ==> 30 ## wtsum ([1 2 3 4], [0 0 1 1]) ==> 7 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- function retval = wtsum (values, weights) Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/drastic_product.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/drastic_product.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/drastic_product.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/drastic_sum.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/drastic_sum.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/drastic_sum.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/dsigmf.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/dsigmf.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/dsigmf.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -65,15 +65,15 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy membership-function sigmoidal +## Keywords: fuzzy-logic-toolkit fuzzy membership sigmoidal ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: dsigmf.m -## Last-Modified: 28 Oct 2011 +## Last-Modified: 20 Aug 2012 function y = dsigmf (x, params) - ## If the caller did not supply 2 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 2 argument values with the correct + ## types, print an error message and halt. if (nargin != 2) puts ("Type 'help dsigmf' for more information.\n"); @@ -94,8 +94,9 @@ a2 = params(3); c2 = params(4); - y_val = @(x_val) max (0, min (1, 1 / (1 + exp (-a1 * (x_val - c1))) - ... - 1 / (1 + exp (-a2 * (x_val - c2))))); + y_val = @(x_val) max (0, ... + min (1, 1 / (1 + exp (-a1 * (x_val - c1))) - ... + 1 / (1 + exp (-a2 * (x_val - c2))))); y = arrayfun (y_val, x); endfunction Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/einstein_product.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/einstein_product.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/einstein_product.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/einstein_sum.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/einstein_sum.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/einstein_sum.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/evalfis.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/evalfis.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/evalfis.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -232,16 +232,17 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: evalfis.m -## Last-Modified: 12 Nov 2011 +## Last-Modified: 20 Aug 2012 function [output, rule_input, rule_output, fuzzy_output] = ... evalfis (user_input, fis, num_points = 101) - ## If evalfis was called with an incorrect number of arguments, or the - ## arguments do not have the correct type, print an error message and halt. + ## If evalfis was called with an incorrect number of arguments, or + ## the arguments do not have the correct type, print an error message + ## and halt. if ((nargin != 2) && (nargin != 3)) puts ("Type 'help evalfis' for more information.\n"); @@ -251,7 +252,7 @@ error ("evalfis's second argument must be an FIS structure\n"); elseif (!is_input_matrix (user_input, fis)) puts ("Type 'help evalfis' for more information.\n"); - error ("evalfis's first argument must be a matrix of input values\n"); + error ("evalfis's 1st argument must be a matrix of input values\n"); elseif (!is_pos_int (num_points)) puts ("Type 'help evalfis' for more information.\n"); error ("evalfis's third argument must be a positive integer\n"); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/evalmf.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/evalmf.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/evalmf.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -58,15 +58,15 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy membership-function evaluate +## Keywords: fuzzy-logic-toolkit fuzzy membership evaluate ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: evalmf.m -## Last-Modified: 13 Nov 2011 +## Last-Modified: 19 Aug 2012 function y = evalmf (x, params, mf_type, hedge = 0, not_flag = false) - ## If the caller did not supply 3 - 5 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 3 - 5 argument values with the correct + ## types, print an error message and halt. if ((nargin < 3) || (nargin > 5)) puts ("Type 'help evalmf' for more information.\n"); @@ -85,8 +85,8 @@ error ("evalmf's fifth argument must be a Boolean\n"); endif - ## Calculate and return the y values of the membership function on the - ## domain x. + ## Calculate and return the y values of the membership function on + ## the domain x. y = evalmf_private (x, params, mf_type, hedge, not_flag); @@ -97,7 +97,8 @@ %! params = [25 50 75]; %! mf_type = 'trimf'; %! y = evalmf(x, params, mf_type); -%! figure('NumberTitle', 'off', 'Name', "evalmf(0:100, [25 50 75], 'trimf')"); +%! figure('NumberTitle', 'off', 'Name', "evalmf(0:100, [25 50 75], ... +%! 'trimf')"); %! plot(x, y, 'LineWidth', 2) %! ylim([-0.1 1.1]); %! xlabel('Crisp Input Value', 'FontWeight', 'bold'); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2012 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -114,13 +114,14 @@ ## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: fcm.m -## Last-Modified: 10 July 2012 +## Last-Modified: 19 Aug 2012 function [cluster_centers, soft_partition, obj_fcn_history] = ... fcm (input_data, num_clusters, options = [2.0, 100, 1e-5, 1]) ## If fcm was called with an incorrect number of arguments, or the - ## arguments do not have the correct type, print an error message and halt. + ## arguments do not have the correct type, print an error message + ## and halt. if ((nargin != 2) && (nargin != 3)) puts ("Type 'help fcm' for more information.\n"); @@ -133,17 +134,19 @@ error ("fcm's second argument must be an integer greater than 1\n"); elseif (!(isreal (options) && isvector (options))) puts ("Type 'help fcm' for more information.\n"); - error ("fcm's third (optional) argument must be a vector of real numbers\n"); + error ("fcm's third argument must be a vector of real numbers\n"); endif - ## Assign options to the more readable variable names: m, max_iterations, - ## epsilon, and display_intermediate_results. If options are missing or - ## NaN (not a number), use the default values. + ## Assign options to the more readable variable names: m, + ## max_iterations, epsilon, and display_intermediate_results. + ## If options are missing or NaN (not a number), use the default + ## values. default_options = [2.0, 100, 1e-5, 1]; for i = 1 : 4 - if ((length (options) < i) || isna (options(i)) || isnan (options(i))) + if ((length (options) < i) || ... + isna (options(i)) || isnan (options(i))) options(i) = default_options(i); endif endfor @@ -160,16 +163,17 @@ display_intermediate_results); endfunction -##------------------------------------------------------------------------------ -## Note: This function (fcm_private) is an implementation of Figure 13.4 in -## Fuzzy Logic: Intelligence, Control and Information, by J. Yen and -## R. Langari, Prentice Hall, 1999, page 380 (International Edition) -## and Algorithm 4.1 in Fuzzy and Neural Control, by Robert Babuska, -## November 2009, p. 63. -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- +## Note: This function (fcm_private) is an implementation of Figure 13.4 +## in Fuzzy Logic: Intelligence, Control and Information, by +## J. Yen and R. Langari, Prentice Hall, 1999, page 380 +## (International Edition) and Algorithm 4.1 in Fuzzy and Neural +## Control, by Robert Babuska, November 2009, p. 63. +##---------------------------------------------------------------------- function [V, Mu, obj_fcn_history] = ... - fcm_private (X, k, m, max_iterations, epsilon, display_intermediate_results) + fcm_private (X, k, m, max_iterations, epsilon, ... + display_intermediate_results) ## Initialize the prototype and the calculation. V = fcm_init_prototype (X, k); @@ -182,23 +186,27 @@ n = rows (X); sqr_dist = square_distance_matrix (X, V); - ## Loop until the objective function is within tolerance or the maximum - ## number of iterations has been reached. - while (convergence_criterion > epsilon && ++iteration <= max_iterations) + ## Loop until the objective function is within tolerance or the + ## maximum number of iterations has been reached. + while (convergence_criterion > epsilon && ... + ++iteration <= max_iterations) V_previous = V; Mu = fcm_update_membership_fcn (V, X, m, k, n, sqr_dist); Mu_m = Mu .^ m; V = fcm_update_cluster_centers (Mu_m, X, k); sqr_dist = square_distance_matrix (X, V); - obj_fcn_history(iteration) = fcm_compute_objective_fcn (Mu_m, sqr_dist); + obj_fcn_history(iteration) = ... + fcm_compute_objective_fcn (Mu_m, sqr_dist); if (display_intermediate_results) printf ("Iteration count = %d, Objective fcn = %8.6f\n", ... iteration, obj_fcn_history(iteration)); endif - convergence_criterion = fcm_compute_convergence_criterion (V, V_previous); + convergence_criterion = ... + fcm_compute_convergence_criterion (V, V_previous); endwhile - ## Remove extraneous entries from the tail of the objective function history. + ## Remove extraneous entries from the tail of the objective + ## function history. if (convergence_criterion <= epsilon) obj_fcn_history = obj_fcn_history(1 : iteration); endif Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_1.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_1.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_1.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2012 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -42,16 +42,17 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm demo +## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: fcm_demo_1.m -## Last-Modified: 10 July 2012 +## Last-Modified: 19 Aug 2012 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Note: The input_data is taken from Chapter 13, Example 17 in -## Fuzzy Logic: Intelligence, Control and Information, by J. Yen and -## R. Langari, Prentice Hall, 1999, page 381 (International Edition). -##------------------------------------------------------------------------------ +## Fuzzy Logic: Intelligence, Control and Information, by J. Yen +## and R. Langari, Prentice Hall, 1999, page 381 (International +## Edition). +##---------------------------------------------------------------------- ## Use fcm to classify the data in matrix x. input_data = [2 12; 4 9; 7 13; 11 5; 12 7; 14 4] @@ -60,22 +61,25 @@ fcm (input_data, number_of_clusters) ## Calculate and print the three validity measures. -printf ("Partition Coefficient: %f\n", partition_coeff (soft_partition)); -printf ("Partition Entropy (with a = 2): %f\n", partition_entropy (soft_partition, 2)); -printf ("Xie-Beni Index: %f\n\n", xie_beni_index (input_data, cluster_centers, soft_partition)); +printf ("Partition Coefficient: %f\n", ... + partition_coeff (soft_partition)); +printf ("Partition Entropy (with a = 2): %f\n", ... + partition_entropy (soft_partition, 2)); +printf ("Xie-Beni Index: %f\n\n", ... + xie_beni_index (input_data, cluster_centers, soft_partition)); ## Plot the data points as small blue x's. figure ('NumberTitle', 'off', 'Name', 'FCM Demo 1'); for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, 'marker', 'x', ... - 'color', 'b'); + plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... + 'marker', 'x', 'color', 'b'); hold on; endfor ## Plot the cluster centers as larger red *'s. for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', 4, ... - 'marker', '*', 'color', 'r'); + plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', ... + 4, 'marker', '*', 'color', 'r'); hold on; endfor Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_2.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_2.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/fcm_demo_2.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2012 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -42,44 +42,48 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm demo +## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: fcm_demo_2.m -## Last-Modified: 10 July 2012 +## Last-Modified: 19 Aug 2012 -##------------------------------------------------------------------------------ -## Note: The input_data was selected to form three areas of different shapes. -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- +## Note: The input_data was selected to form three areas of different +## shapes. +##---------------------------------------------------------------------- ## Use fcm to classify the data in matrix x. -input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; 3 12 5; - 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; 3 5 11; 4 4 9; - 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; 9 12 13; 9 13 14; 10 9 13; - 10 13 12; 11 10 14; 11 12 13; 12 6 12; 12 7 15; 12 9 15; 14 6 14; - 14 8 13] +input_data = [1 11 5; 1 12 6; 1 13 5; 2 11 7; 2 12 6; 2 13 7; 3 11 6; + 3 12 5; 3 13 7; 1 1 10; 1 3 9; 2 2 11; 3 1 9; 3 3 10; + 3 5 11; 4 4 9; 4 6 8; 5 5 8; 5 7 9; 6 6 10; 9 10 12; + 9 12 13; 9 13 14; 10 9 13; 10 13 12; 11 10 14; 11 12 13; + 12 6 12; 12 7 15; 12 9 15; 14 6 14; 14 8 13] number_of_clusters = 3 [cluster_centers, soft_partition, obj_fcn_history] = ... fcm (input_data, number_of_clusters, [NaN NaN NaN 0]) ## Calculate and print the three validity measures. -printf ("Partition Coefficient: %f\n", partition_coeff (soft_partition)); -printf ("Partition Entropy (with a = 2): %f\n", partition_entropy (soft_partition, 2)); -printf ("Xie-Beni Index: %f\n\n", xie_beni_index (input_data, cluster_centers, soft_partition)); +printf ("Partition Coefficient: %f\n", ... + partition_coeff (soft_partition)); +printf ("Partition Entropy (with a = 2): %f\n", ... + partition_entropy (soft_partition, 2)); +printf ("Xie-Beni Index: %f\n\n", ... + xie_beni_index (input_data, cluster_centers, soft_partition)); ## Plot the data points in two dimensions (using features 1 and 2) ## as small blue x's. figure ('NumberTitle', 'off', 'Name', 'FCM Demo 2'); for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, 'marker', 'x', ... - 'color', 'b'); + plot (input_data(i, 1), input_data(i, 2), 'LineWidth', 2, ... + 'marker', 'x', 'color', 'b'); hold on; endfor ## Plot the cluster centers in two dimensions (using features 1 and 2) ## as larger red *'s. for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', 4, ... - 'marker', '*', 'color', 'r'); + plot (cluster_centers(i, 1), cluster_centers(i, 2), 'LineWidth', ... + 4, 'marker', '*', 'color', 'r'); hold on; endfor @@ -97,16 +101,16 @@ ## as small blue x's. figure ('NumberTitle', 'off', 'Name', 'FCM Demo 2'); for i = 1 : rows (input_data) - plot (input_data(i, 1), input_data(i, 3), 'LineWidth', 2, 'marker', 'x', ... - 'color', 'b'); + plot (input_data(i, 1), input_data(i, 3), 'LineWidth', 2, ... + 'marker', 'x', 'color', 'b'); hold on; endfor ## Plot the cluster centers in two dimensions (using features 1 and 3) ## as larger red *'s. for i = 1 : number_of_clusters - plot (cluster_centers(i, 1), cluster_centers(i, 3), 'LineWidth', 4, ... - 'marker', '*', 'color', 'r'); + plot (cluster_centers(i, 1), cluster_centers(i, 3), 'LineWidth', ... + 4, 'marker', '*', 'color', 'r'); hold on; endfor Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gauss2mf.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gauss2mf.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gauss2mf.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -64,15 +64,15 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy membership-function gaussian +## Keywords: fuzzy-logic-toolkit fuzzy membership gaussian ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: gauss2mf.m -## Last-Modified: 28 Oct 2011 +## Last-Modified: 19 Aug 2012 function y = gauss2mf (x, params) - ## If the caller did not supply 2 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 2 argument values with the correct + ## types, print an error message and halt. if (nargin != 2) puts ("Type 'help gauss2mf' for more information.\n"); @@ -85,16 +85,17 @@ error ("gauss2mf's second argument must be a parameter vector\n"); endif - ## Calculate and return the y values of the membership function on the - ## domain x according to the definition of gauss2mf given in the comment - ## above. + ## Calculate and return the y values of the membership function on + ## the domain x according to the definition of gauss2mf given in the + ## comment above. sig1 = params(1); c1 = params(2); sig2 = params(3); c2 = params(4); - f1_val = @(x_val) (x_val <= c1) * exp ((-(x_val - c1)^2)/(2 * sig1^2)) + ... + f1_val = @(x_val) (x_val <= c1) * ... + exp ((-(x_val - c1)^2)/(2 * sig1^2)) + ... (x_val > c1); f2_val = @(x_val) (x_val <= c2) + ... Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gaussmf.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gaussmf.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gaussmf.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -60,15 +60,15 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy membership-function gaussian +## Keywords: fuzzy-logic-toolkit fuzzy membership gaussian ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: gaussmf.m -## Last-Modified: 28 Oct 2011 +## Last-Modified: 19 Aug 2012 function y = gaussmf (x, params) - ## If the caller did not supply 2 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 2 argument values with the correct + ## types, print an error message and halt. if (nargin != 2) puts ("Type 'help gaussmf' for more information.\n"); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gbellmf.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gbellmf.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gbellmf.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -64,15 +64,15 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy membership-function bell-shaped bell +## Keywords: fuzzy-logic-toolkit fuzzy membership bell-shaped bell ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: gbellmf.m -## Last-Modified: 28 Oct 2011 +## Last-Modified: 19 Aug 2012 function y = gbellmf (x, params) - ## If the caller did not supply 2 argument values with the correct types, - ## print an error message and halt. + ## If the caller did not supply 2 argument values with the correct + ## types, print an error message and halt. if (nargin != 2) puts ("Type 'help gbellmf' for more information.\n"); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gensurf.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gensurf.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/gensurf.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -70,7 +70,7 @@ ## sugeno_tip_demo.m ## @end itemize ## -## CURRENT LIMITATION: +## Current limitation: ## The form of gensurf that suppresses plotting (the final form above) is not yet ## implemented. ## @@ -78,16 +78,18 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis plot +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis plot ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: gensurf.m -## Last-Modified: 11 Nov 2011 +## Last-Modified: 19 Aug 2012 -function [x, y, z] = gensurf (fis, input_axes = [1 2], output_axis = 1, ... - grids = [15 15], ref_input = [], num_points = 101) +function [x, y, z] = gensurf (fis, input_axes = [1 2], ... + output_axis = 1, grids = [15 15], ... + ref_input = [], num_points = 101) - ## If gensurf was called with an incorrect number of arguments, or the - ## arguments do not have the correct type, print an error message and halt. + ## If gensurf was called with an incorrect number of arguments, + ## or the arguments do not have the correct type, print an error + ## message and halt. if ((nargin < 1) || (nargin > 6)) puts ("Type 'help gensurf' for more information.\n"); @@ -103,32 +105,34 @@ error ("gensurf's third argument must be a valid output index\n"); elseif ((nargin >= 4) && !is_grid_spec (grids)) puts ("Type 'help gensurf' for more information.\n"); - error ("gensurf's fourth argument must be a valid grid specification\n"); + error ("gensurf's 4th argument must be a grid specification\n"); elseif ((nargin >= 5) && !is_ref_input (ref_input, fis, input_axes)) puts ("Type 'help gensurf' for more information.\n"); - error ("gensurf's fifth argument must specify reference input values\n"); - elseif ((nargin == 6) && !(is_pos_int (num_points) && (num_points >= 2))) + error ("gensurf's 5th argument must be reference input values\n"); + elseif ((nargin == 6) && ... + !(is_pos_int (num_points) && (num_points >= 2))) puts ("Type 'help gensurf' for more information.\n"); - error ("gensurf's sixth argument to gensurf must be an integer >= 2\n"); + error ("gensurf's sixth argument must be an integer >= 2\n"); endif if (length (input_axes) == 1 || columns (fis.input) == 1) - generate_plot (fis, input_axes, output_axis, grids, ref_input, num_points); + generate_plot (fis, input_axes, output_axis, grids, ... + ref_input, num_points); else - generate_surface (fis, input_axes, output_axis, grids, ref_input, ... - num_points); + generate_surface (fis, input_axes, output_axis, grids, ... + ref_input, num_points); endif endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Function: generate_plot ## Purpose: Generate a plot representing one of the FIS outputs as a ## function of one of the FIS inputs. -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- -function [x, y, z] = generate_plot (fis, input_axis, output_axis, grids, ... - ref_input, num_points) +function [x, y, z] = generate_plot (fis, input_axis, output_axis, ... + grids, ref_input, num_points) ## Create input to FIS using grid points and reference values. @@ -163,14 +167,14 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Function: generate_surface -## Purpose: Generate a surface representing one of the FIS outputs as a -## function of two of the FIS inputs. -##------------------------------------------------------------------------------ +## Purpose: Generate a surface representing one of the FIS outputs as +## a function of two of the FIS inputs. +##---------------------------------------------------------------------- -function [x, y, z] = generate_surface (fis, input_axes, output_axis, grids, ... - ref_input, num_points) +function [x, y, z] = generate_surface (fis, input_axes, output_axis, ... + grids, ref_input, num_points) ## Create input to FIS using grid points and reference values. @@ -203,7 +207,8 @@ ## Compute the output and reshape it to fit the grid. output = evalfis_private (fis_input, fis, num_points); - z_matrix = reshape (output(:, output_axis), length (x_axis), length (y_axis)); + z_matrix = reshape (output(:, output_axis), length (x_axis), ... + length (y_axis)); ## Plot the surface. Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/getfis.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/getfis.m 2012-08-24 16:11:37 UTC (rev 10908) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/getfis.m 2012-08-24 16:13:07 UTC (rev 10909) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -90,15 +90,16 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/ ## Filename: getfis.m -## Last-Modified: 31 Oct 2011 +## Last-Modified: 20 Aug 2012 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- function retval = getfis (fis, arg2 = 'dummy', arg3 = 'dummy', ... - arg4 = 'dummy', arg5 = 'dummy', arg6 = 'dummy') + arg4 = 'dummy', arg5 = 'dummy', ... + arg6 = 'dummy') switch (nargin) case 1 retval = getfis_one_arg (fis); @@ -106,7 +107,8 @@ case 3 retval = getfis_three_args (fis, arg2, arg3); case 4 retval = getfis_four_args (fis, arg2, arg3, arg4); case 5 retval = getfis_five_args (fis, arg2, arg3, arg4, arg5); - case 6 retval = getfis_six_args (fis, arg2, arg3, arg4, arg5, arg6); + case 6 retval = getfis_six_args (fis, arg2, arg3, arg4, arg5, ... + arg6); otherwise puts ("Type 'help getfis' for more information.\n"); error ("getfis requires 1-6 arguments\n"); @@ -114,11 +116,11 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Function: getfis_one_arg -## Purpose: Handle calls to getfis that have 1 argument. -## See the comment at the top of this file for more complete info. -##------------------------------------------------------------------------------ +## Purpose... [truncated message content] |
From: <lm...@us...> - 2012-08-24 16:11:45
|
Revision: 10908 http://octave.svn.sourceforge.net/octave/?rev=10908&view=rev Author: lmarkov Date: 2012-08-24 16:11:37 +0000 (Fri, 24 Aug 2012) Log Message: ----------- M private/is_builtin_language.m M private/evalmf_private.m M private/get_mf_index_and_hedge.m M private/fcm_update_membership_fcn.m M private/is_var_index.m M private/is_fis.m M private/fcm_init_prototype.m M private/is_input_matrix.m M private/is_real.m M private/defuzzify_output_sugeno.m M private/fcm_compute_objective_fcn.m M private/is_io_vector.m M private/are_input_indices.m M private/is_rule_vector.m M private/defuzzify_output_mamdani.m M private/aggregate_output_sugeno.m M private/is_ref_input.m M private/is_grid_spec.m M private/fcm_update_cluster_centers.m M private/is_real_matrix.m M private/eval_firing_strength.m M private/is_io_struct.m M private/is_pos_int.m M private/is_rule_struct.m M private/is_mf_vector.m M private/are_bounds.m M private/eval_rules_sugeno.m M private/is_output_index.m M private/is_format.m M private/evalfis_private.m M private/is_mf_index.m M private/is_row_vector.m M private/is_rule_index_list.m M private/is_int.m M private/fuzzify_input.m M private/eval_rules_mamdani.m M private/aggregate_output_mamdani.m M private/are_mf_params.m M private/fcm_compute_convergence_criterion.m M private/square_distance_matrix.m M private/is_mf_struct.m M private/is_string.m M private/is_domain.m M private/probor.m Modified Paths: -------------- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_mamdani.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_sugeno.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_bounds.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_input_indices.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_mf_params.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/defuzzify_output_mamdani.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/defuzzify_output_sugeno.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_firing_strength.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_rules_mamdani.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_rules_sugeno.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalfis_private.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalmf_private.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_compute_convergence_criterion.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_compute_objective_fcn.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_init_prototype.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_update_cluster_centers.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_update_membership_fcn.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fuzzify_input.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/get_mf_index_and_hedge.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_builtin_language.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_domain.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_fis.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_format.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_grid_spec.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_input_matrix.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_int.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_io_struct.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_io_vector.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_index.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_struct.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_vector.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_output_index.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_pos_int.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_real.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_real_matrix.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_ref_input.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_row_vector.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_rule_index_list.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_rule_struct.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_rule_vector.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_string.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_var_index.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/probor.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/square_distance_matrix.m Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_mamdani.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_mamdani.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_mamdani.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -73,15 +73,15 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: aggregate_output_mamdani.m -## Last-Modified: 3 Nov 2011 +## Last-Modified: 20 Aug 2012 function fuzzy_output = aggregate_output_mamdani (fis, rule_output) - num_rules = columns (fis.rule); ## num_rules == Q (above) - num_outputs = columns (fis.output); ## num_outputs == L + num_rules = columns (fis.rule); ## num_rules == Q (above) + num_outputs = columns (fis.output); ## num_outputs == L num_points = rows (rule_output); ## Initialize output matrix to prevent inefficient resizing. @@ -90,7 +90,8 @@ ## Compute the ith fuzzy output values, then store the values in the ## ith column of the fuzzy_output matrix. for i = 1 : num_outputs - indiv_fuzzy_out = rule_output(:, (i - 1) * num_rules + 1 : i * num_rules); + indiv_fuzzy_out = ... + rule_output(:, (i - 1) * num_rules + 1 : i * num_rules); agg_fuzzy_out = (str2func (fis.aggMethod) (indiv_fuzzy_out'))'; fuzzy_output(:, i) = agg_fuzzy_out; endfor Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_sugeno.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_sugeno.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_sugeno.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -71,12 +71,12 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: aggregate_output_sugeno.m -## Last-Modified: 10 Nov 2011 +## Last-Modified: 20 Aug 2012 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- function fuzzy_output = aggregate_output_sugeno (fis, rule_output) @@ -84,12 +84,13 @@ num_outputs = columns (fis.output); num_rules = columns (fis.rule); - ## For each FIS output, aggregate the slice of the rule_output matrix, + ## For each FIS output, aggregate the slice of the rule_output matrix, ## then store the result as a structure in fuzzy_output. for i = 1 : num_outputs unagg_output = rule_output(:, (i-1)*num_rules+1 : i*num_rules); - aggregated_output = aggregate_fis_output (fis.aggMethod, unagg_output); + aggregated_output = aggregate_fis_output (fis.aggMethod, ... + unagg_output); next_agg_output = struct ('index', i, ... 'aggregated_output', aggregated_output); if (i == 1) @@ -100,19 +101,20 @@ endfor endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Function: aggregate_fis_output ## Purpose: Aggregate the multiple singletons for one FIS output. -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- -function mult_singletons = aggregate_fis_output (fis_aggmethod, rule_output) +function mult_singletons = aggregate_fis_output (fis_aggmethod, ... + rule_output) ## Initialize output matrix (multiple_singletons). mult_singletons = sortrows (rule_output', 1); - ## If adjacent rows represent singletons at the same location, then combine - ## them using the FIS aggregation method. + ## If adjacent rows represent singletons at the same location, then + ## combine them using the FIS aggregation method. for i = 1 : rows (mult_singletons) - 1 if (mult_singletons(i, 1) == mult_singletons(i+1, 1)) @@ -129,16 +131,18 @@ endif endfor - ## Return the transpose of the matrix after removing 0-height singletons. + ## Return the transpose of the matrix after removing 0-height + ## singletons. mult_singletons = (remove_null_rows (mult_singletons))'; endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Function: remove_null_rows -## Purpose: Return the argument without the rows with a 0 in the second column. -##------------------------------------------------------------------------------ +## Purpose: Return the argument without the rows with a 0 in the +## second column. +##---------------------------------------------------------------------- function y = remove_null_rows (x) y = []; Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_bounds.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_bounds.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_bounds.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_input_indices.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_input_indices.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_input_indices.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_mf_params.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_mf_params.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/are_mf_params.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -32,7 +32,7 @@ ## Keywords: fuzzy-logic-toolkit fuzzy private parameter-test ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: are_mf_params.m -## Last-Modified: 19 May 2011 +## Last-Modified: 20 Aug 2012 function y = are_mf_params (type, params) @@ -55,11 +55,12 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = real_vector (params) ## -## Return 1 if params is a vector of real numbers, and return 0 otherwise. -##------------------------------------------------------------------------------ +## Return 1 if params is a vector of real numbers, and +## return 0 otherwise. +##---------------------------------------------------------------------- function y = real_vector (params) @@ -67,11 +68,12 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = two_reals (params) ## -## Return 1 if params is a vector of 2 real numbers, and return 0 otherwise. -##------------------------------------------------------------------------------ +## Return 1 if params is a vector of 2 real numbers, and +## return 0 otherwise. +##---------------------------------------------------------------------- function y = two_reals (params) @@ -79,11 +81,12 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = three_reals (params) ## -## Return 1 if params is a vector of 3 real numbers, and return 0 otherwise. -##------------------------------------------------------------------------------ +## Return 1 if params is a vector of 3 real numbers, and +## return 0 otherwise. +##---------------------------------------------------------------------- function y = three_reals (params) @@ -91,11 +94,12 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = four_reals (params) ## -## Return 1 if params is a vector of 4 real numbers, and return 0 otherwise. -##------------------------------------------------------------------------------ +## Return 1 if params is a vector of 4 real numbers, and +## return 0 otherwise. +##---------------------------------------------------------------------- function y = four_reals (params) @@ -103,13 +107,13 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = gbellmf_params (params) ## y = gbellmf_params ([a b c]) ## -## Return 1 if params is a vector of 3 real numbers, [a b c], with a != 0 and -## integral-valued b, and return 0 otherwise. -##------------------------------------------------------------------------------ +## Return 1 if params is a vector of 3 real numbers, [a b c], with +## a != 0 and integral-valued b, and return 0 otherwise. +##---------------------------------------------------------------------- function y = gbellmf_params (params) @@ -117,13 +121,13 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = pimf_params (params) ## y = pimf_params ([a b c d]) ## ## Return 1 if params is a vector of 4 real numbers, [a b c d], with ## a < b <= c < d, and return 0 otherwise. -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- function y = pimf_params (params) @@ -134,13 +138,13 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = smf_params (params) ## y = smf_params ([a b]) ## ## Return 1 if params is a vector of 2 real numbers, [a b], with a < b, ## and return 0 otherwise. -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- function y = smf_params (params) @@ -148,13 +152,13 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = trapmf_params (params) ## y = trapmf_params ([a b c d]) ## ## Return 1 if params is a vector of 4 real numbers, [a b c d], with ## a < b <= c < d, and return 0 otherwise. -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- function y = trapmf_params (params) @@ -165,13 +169,13 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = trimf_params (params) ## y = trimf_params ([a b c]) ## -## Return 1 if params is a vector of 3 real numbers, [a b c], with a < b < c, -## and return 0 otherwise. -##------------------------------------------------------------------------------ +## Return 1 if params is a vector of 3 real numbers, [a b c], with +## a < b < c, and return 0 otherwise. +##---------------------------------------------------------------------- function y = trimf_params (params) @@ -181,13 +185,13 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Usage: y = zmf_params (params) ## y = zmf_params ([a b]) ## -## Return 1 if params is a vector of 2 real numbers, [a b], with a < b, and -## return 0 otherwise. -##------------------------------------------------------------------------------ +## Return 1 if params is a vector of 2 real numbers, [a b], with a < b, +## and return 0 otherwise. +##---------------------------------------------------------------------- function y = zmf_params (params) Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/defuzzify_output_mamdani.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/defuzzify_output_mamdani.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/defuzzify_output_mamdani.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -64,14 +64,14 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: defuzzify_output_mamdani.m -## Last-Modified: 30 Aug 2011 +## Last-Modified: 20 Aug 2012 function output = defuzzify_output_mamdani (fis, fuzzy_output) - num_outputs = columns (fis.output); ## num_outputs == L (above) + num_outputs = columns (fis.output); ## num_outputs == L (above) num_points = rows (fuzzy_output); output = zeros (1, num_outputs); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/defuzzify_output_sugeno.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/defuzzify_output_sugeno.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/defuzzify_output_sugeno.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -64,10 +64,10 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: defuzzify_output_sugeno.m -## Last-Modified: 29 Aug 2011 +## Last-Modified: 20 Aug 2012 function output = defuzzify_output_sugeno (fis, aggregated_output) Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_firing_strength.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_firing_strength.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_firing_strength.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -57,27 +57,27 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: eval_firing_strength.m -## Last-Modified: 3 Nov 2011 +## Last-Modified: 20 Aug 2012 function firing_strength = eval_firing_strength (fis, rule_input) - num_rules = columns (fis.rule); ## num_rules == Q (above) - num_inputs = columns (fis.input); ## num_inputs == N + num_rules = columns (fis.rule); ## num_rules == Q (above) + num_inputs = columns (fis.input); ## num_inputs == N ## Initialize output matrix to prevent inefficient resizing. firing_strength = zeros (1, num_rules); ## For each rule - ## 1. Apply connection to find matching degree of the rule antecedent. + ## 1. Apply connection to find matching degree of the antecedent. ## 2. Multiply by weight of the rule to find degree of the rule. for i = 1 : num_rules rule = fis.rule(i); - ## Collect mu values for all input variables in the rule's antecedent. + ## Collect mu values for all input variables in the antecedent. antecedent_mus = []; for j = 1 : num_inputs if (rule.antecedent(j) != 0) @@ -94,33 +94,47 @@ endif switch (connect) case 'min' - firing_strength(i) = rule.weight * min (antecedent_mus); + firing_strength(i) = rule.weight * ... + min (antecedent_mus); case 'max' - firing_strength(i) = rule.weight * max (antecedent_mus); + firing_strength(i) = rule.weight * ... + max (antecedent_mus); case 'prod' - firing_strength(i) = rule.weight * prod (antecedent_mus); + firing_strength(i) = rule.weight * ... + prod (antecedent_mus); case 'sum' - firing_strength(i) = rule.weight * sum (antecedent_mus); + firing_strength(i) = rule.weight * ... + sum (antecedent_mus); case 'algebraic_product' - firing_strength(i) = rule.weight * prod (antecedent_mus); + firing_strength(i) = rule.weight * ... + prod (antecedent_mus); case 'algebraic_sum' - firing_strength(i) = rule.weight * algebraic_sum (antecedent_mus); + firing_strength(i) = rule.weight * ... + algebraic_sum (antecedent_mus); case 'bounded_difference' - firing_strength(i) = rule.weight * bounded_difference (antecedent_mus); + firing_strength(i) = rule.weight * ... + bounded_difference (antecedent_mus); case 'bounded_sum' - firing_strength(i) = rule.weight * bounded_sum (antecedent_mus); + firing_strength(i) = rule.weight * ... + bounded_sum (antecedent_mus); case 'einstein_product' - firing_strength(i) = rule.weight * einstein_product (antecedent_mus); + firing_strength(i) = rule.weight * ... + einstein_product (antecedent_mus); case 'einstein_sum' - firing_strength(i) = rule.weight * einstein_sum (antecedent_mus); + firing_strength(i) = rule.weight * ... + einstein_sum (antecedent_mus); case 'hamacher_product' - firing_strength(i) = rule.weight * hamacher_product (antecedent_mus); + firing_strength(i) = rule.weight * ... + hamacher_product (antecedent_mus); case 'hamacher_sum' - firing_strength(i) = rule.weight * hamacher_sum (antecedent_mus); + firing_strength(i) = rule.weight * ... + hamacher_sum (antecedent_mus); case 'drastic_product' - firing_strength(i) = rule.weight * drastic_product (antecedent_mus); + firing_strength(i) = rule.weight * ... + drastic_product (antecedent_mus); case 'drastic_sum' - firing_strength(i) = rule.weight * drastic_sum (antecedent_mus); + firing_strength(i) = rule.weight * ... + drastic_sum (antecedent_mus); otherwise firing_strength(i) = rule.weight * ... str2func (connect) (antecedent_mus); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_rules_mamdani.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_rules_mamdani.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_rules_mamdani.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -64,15 +64,16 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: eval_rules_mamdani.m -## Last-Modified: 1 Nov 2011 +## Last-Modified: 20 Aug 2012 -function rule_output = eval_rules_mamdani (fis, firing_strength, num_points) +function rule_output = eval_rules_mamdani (fis, firing_strength, ... + num_points) - num_rules = columns (fis.rule); ## num_rules == Q (above) - num_outputs = columns (fis.output); ## num_outputs == L + num_rules = columns (fis.rule); ## num_rules == Q (above) + num_outputs = columns (fis.output); ## num_outputs == L ## Initialize output matrix to prevent inefficient resizing. rule_output = zeros (num_points, num_rules*num_outputs); @@ -91,11 +92,12 @@ ## Compute the fuzzy output for this (rule, output) pair. - [mf_index hedge not_flag] = get_mf_index_and_hedge (rule.consequent(j)); + [mf_index hedge not_flag] = ... + get_mf_index_and_hedge (rule.consequent(j)); if (mf_index != 0) - ## First, get the fuzzy output, adjusting for the hedge and not_flag, - ## but not for the rule matching degree. + ## First, get the fuzzy output, adjusting for the hedge and + ## not_flag, but not for the rule matching degree. range = fis.output(j).range; mf = fis.output(j).mf(mf_index); @@ -110,8 +112,8 @@ case 'prod' fuzzy_out *= rule_matching_degree; otherwise - fuzzy_out = str2func (fis.impMethod) (rule_matching_degree, ... - fuzzy_out); + fuzzy_out = str2func (fis.impMethod) ... + (rule_matching_degree, fuzzy_out); endswitch ## Store result in column of rule_output corresponding Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_rules_sugeno.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_rules_sugeno.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/eval_rules_sugeno.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -61,29 +61,30 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: eval_rules_sugeno.m -## Last-Modified: 1 Nov 2011 +## Last-Modified: 20 Aug 2012 -function rule_output = eval_rules_sugeno (fis, firing_strength, user_input) +function rule_output = eval_rules_sugeno (fis, firing_strength, ... + user_input) - num_rules = columns (fis.rule); ## num_rules == Q (above) - num_outputs = columns (fis.output); ## num_outputs == L + num_rules = columns (fis.rule); ## num_rules == Q (above) + num_outputs = columns (fis.output); ## num_outputs == L ## Initialize output matrix to prevent inefficient resizing. rule_output = zeros (2, num_rules * num_outputs); ## Compute the (location, height) of the singleton output by each ## (rule, output) pair: - ## 1. The height is given by the firing strength of the rule, and by - ## the hedge and the not flag for the (rule, output) pair. + ## 1. The height is given by the firing strength of the rule, and + ## by the hedge and the not flag for the (rule, output) pair. ## 2. If the consequent membership function is constant, then the - ## membership function's parameter gives the location of the singleton. - ## If the consequent membership function is linear, then the - ## location is the inner product of the the membership function's - ## parameters and the vector formed by appending a 1 to the user input - ## vector. + ## membership function's parameter gives the location of the + ## singleton. If the consequent membership function is linear, + ## then the location is the inner product of the the membership + ## function's parameters and the vector formed by appending a 1 + ## to the user input vector. for i = 1 : num_rules rule = fis.rule(i); @@ -93,10 +94,12 @@ for j = 1 : num_outputs ## Compute the singleton height for this (rule, output) pair. - ## Note that for Sugeno FISs, the hedge and not flag are handled by - ## adjusting the height of the singletons for each (rule, output) pair. + ## Note that for Sugeno FISs, the hedge and not flag are handled + ## by adjusting the height of the singletons for each + ## (rule, output) pair. - [mf_index hedge not_flag] = get_mf_index_and_hedge (rule.consequent(j)); + [mf_index hedge not_flag] = ... + get_mf_index_and_hedge (rule.consequent(j)); height = rule_firing_strength; if (hedge != 0) height = height ^ (1 / hedge); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalfis_private.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalfis_private.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalfis_private.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -31,10 +31,10 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: evalfis_private.m -## Last-Modified: 19 May 2011 +## Last-Modified: 20 Aug 2012 function [output, rule_input, rule_output, fuzzy_output] = ... evalfis_private (user_input, fis, num_points = 101) @@ -51,11 +51,13 @@ rule_input = fuzzify_input (fis, user_input(i, :)); firing_strength = eval_firing_strength (fis, rule_input); if (strcmp (fis.type, 'mamdani')) - rule_output = eval_rules_mamdani (fis, firing_strength, num_points); + rule_output = eval_rules_mamdani (fis, firing_strength, ... + num_points); fuzzy_output = aggregate_output_mamdani (fis, rule_output); output(i, :) = defuzzify_output_mamdani (fis, fuzzy_output); else - rule_output = eval_rules_sugeno (fis, firing_strength, user_input(i, :)); + rule_output = eval_rules_sugeno (fis, firing_strength, ... + user_input(i, :)); fuzzy_output = aggregate_output_sugeno (fis, rule_output); output(i, :) = defuzzify_output_sugeno (fis, fuzzy_output); endif Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalmf_private.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalmf_private.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalmf_private.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -34,14 +34,16 @@ ## Keywords: fuzzy-logic-toolkit fuzzy membership-function evaluate ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: evalmf_private.m -## Last-Modified: 2 Nov 2011 +## Last-Modified: 20 Aug 2012 -function y = evalmf_private (x, params, mf_type, hedge = 0, not_flag = false) +function y = evalmf_private (x, params, mf_type, hedge = 0, ... + not_flag = false) ## Calculate and return the y values of the membership function on - ## the domain x. First, get the value of the membership function without - ## correcting for the hedge and not_flag. Then, for non-linear functions, - ## adjust the function values for non-zero hedge and not_flag. + ## the domain x. First, get the value of the membership function + ## without correcting for the hedge and not_flag. Then, for non-linear + ## functions, adjust the function values for non-zero hedge and + ## not_flag. switch (mf_type) case 'constant' @@ -65,11 +67,12 @@ endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Function: eval_constant -## Purpose: Return the y-values corresponding to the x-values in the domain -## for the constant function specified by the parameter c. -##------------------------------------------------------------------------------ +## Purpose: Return the y-values corresponding to the x-values in +## the domain for the constant function specified by the +## parameter c. +##---------------------------------------------------------------------- function y = eval_constant (x, c) y = zeros (length (x)); @@ -78,16 +81,17 @@ y = arrayfun (y_val, x); endfunction -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Function: eval_linear -## Purpose: For the parameters [a ... c]), return the y-values corresponding -## to the linear function y = a*x + c, where x takes on the the -## x-values in the domain. The remaining coefficients in the parameter -## list are not used -- this creates a two-dimensional intersection of -## the linear output membership function suitable for display together -## with other membership functions, but does not fully represent the -## output membership function. -##------------------------------------------------------------------------------ +## Purpose: For the parameters [a ... c]), return the y-values +## corresponding to the linear function y = a*x + c, where x +## takes on the the x-values in the domain. The remaining +## coefficients in the parameter list are not used -- this +## creates a two-dimensional intersection of the linear output +## membership function suitable for display together with +## other membership functions, but does not fully represent +## the output membership function. +##---------------------------------------------------------------------- function y = eval_linear (x, params) if (length (params) == 1) Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_compute_convergence_criterion.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_compute_convergence_criterion.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_compute_convergence_criterion.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2012 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -27,12 +27,13 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm private +## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: fcm_compute_convergence_criterion.m -## Last-Modified: 7 July 2012 +## Last-Modified: 20 Aug 2012 -function convergence_criterion = fcm_compute_convergence_criterion (V, V_previous) +function convergence_criterion = ... + fcm_compute_convergence_criterion (V, V_previous) V_delta = V - V_previous; convergence_criterion = sum (sqrt (sum (V_delta .* V_delta)')); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_compute_objective_fcn.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_compute_objective_fcn.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_compute_objective_fcn.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2012 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -26,16 +26,17 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm private +## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: fcm_compute_objective_fcn.m -## Last-Modified: 7 July 2012 +## Last-Modified: 20 Aug 2012 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Note: This function is an implementation of Equation 13.3 in -## Fuzzy Logic: Intelligence, Control and Information, by J. Yen and -## R. Langari, Prentice Hall, 1999, page 379 (International Edition). -##------------------------------------------------------------------------------ +## Fuzzy Logic: Intelligence, Control and Information, by +## J. Yen and R. Langari, Prentice Hall, 1999, page 379 +## (International Edition). +##---------------------------------------------------------------------- function obj_fcn = fcm_compute_objective_fcn (Mu_m, sqr_dist) Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_init_prototype.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_init_prototype.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_init_prototype.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2012 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -27,10 +27,10 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm private +## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: fcm_init_prototype.m -## Last-Modified: 7 July 2012 +## Last-Modified: 20 Aug 2012 function V = fcm_init_prototype (X, k) @@ -40,8 +40,8 @@ V = rand (k, num_features); for i = 1 : num_features - V(:, i) = (max_feature_value(i) - min_feature_value(i)) * V(:, i) + ... - min_feature_value(i); + V(:, i) = (max_feature_value(i) - min_feature_value(i)) * ... + V(:, i) + min_feature_value(i); endfor endfunction Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_update_cluster_centers.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_update_cluster_centers.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_update_cluster_centers.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2012 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -27,16 +27,17 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm private +## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: fcm_update_cluster_centers.m -## Last-Modified: 7 July 2012 +## Last-Modified: 20 Aug 2012 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Note: This function is an implementation of Equation 13.5 in -## Fuzzy Logic: Intelligence, Control and Information, by J. Yen and -## R. Langari, Prentice Hall, 1999, page 380 (International Edition). -##------------------------------------------------------------------------------ +## Fuzzy Logic: Intelligence, Control and Information, by +## J. Yen and R. Langari, Prentice Hall, 1999, page 380 +## (International Edition). +##---------------------------------------------------------------------- function V = fcm_update_cluster_centers (Mu_m, X, k) Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_update_membership_fcn.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_update_membership_fcn.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fcm_update_membership_fcn.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2012 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -26,18 +26,19 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm private +## Keywords: fuzzy-logic-toolkit fuzzy partition clustering fcm ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: fcm_update_membership_fcn.m -## Last-Modified: 7 July 2012 +## Last-Modified: 20 Aug 2012 -##------------------------------------------------------------------------------ +##---------------------------------------------------------------------- ## Note: This function is an implementation of Equation 13.4 in -## Fuzzy Logic: Intelligence, Control and Information, by J. Yen and -## R. Langari, Prentice Hall, 1999, page 380 (International Edition) -## and Step 3 of Algorithm 4.1 in Fuzzy and Neural Control, -## by Robert Babuska, November 2009, p. 63. -##------------------------------------------------------------------------------ +## Fuzzy Logic: Intelligence, Control and Information, by +## J. Yen and R. Langari, Prentice Hall, 1999, page 380 +## (International Edition) and Step 3 of Algorithm 4.1 in +## Fuzzy and Neural Control, by Robert Babuska, November 2009, +## p. 63. +##---------------------------------------------------------------------- function Mu = fcm_update_membership_fcn (V, X, m, k, n, sqr_dist) @@ -54,7 +55,7 @@ if (summation != 0) Mu(i, j) = 1.0 / summation; else - error ("division by 0 in function fcm_update_membership_fcn'\n"); + error ("division by 0 in fcm_update_membership_fcn'\n"); endif endfor endfor @@ -69,7 +70,7 @@ endif endfor endfor - Mu = Mu / num_zeros; ## Does this need to be randomized? + Mu = Mu / num_zeros; endif endfunction Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fuzzify_input.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fuzzify_input.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/fuzzify_input.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -62,18 +62,19 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: fuzzify_input.m -## Last-Modified: 1 Nov 2011 +## Last-Modified: 20 Aug 2012 function rule_input = fuzzify_input (fis, user_input) - num_rules = columns (fis.rule); ## num_rules == Q (above) - num_inputs = columns (fis.input); ## num_inputs == N - rule_input = zeros (num_rules, num_inputs); ## init to prevent resizing + num_rules = columns (fis.rule); ## num_rules == Q (above) + num_inputs = columns (fis.input); ## num_inputs == N + rule_input = zeros (num_rules, num_inputs); ## to prevent resizing - ## For each rule i and each input j, compute the value of mu in the result. + ## For each rule i and each input j, compute the value of mu + ## in the result. for i = 1 : num_rules antecedent = fis.rule(i).antecedent; @@ -81,9 +82,11 @@ mu = 0; crisp_x = user_input(j); - ## Get the value of mu (with adjustment for the hedge and not_flag). + ## Get the value of mu (with adjustment for the hedge + ## and not_flag). - [mf_index hedge not_flag] = get_mf_index_and_hedge (antecedent(j)); + [mf_index hedge not_flag] = ... + get_mf_index_and_hedge (antecedent(j)); if (mf_index != 0) mf = fis.input(j).mf(mf_index); mu = evalmf (crisp_x, mf.params, mf.type, hedge, not_flag); Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/get_mf_index_and_hedge.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/get_mf_index_and_hedge.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/get_mf_index_and_hedge.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -33,14 +33,16 @@ ## @end deftypefn ## Author: L. Markowsky -## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis +## Keywords: fuzzy-logic-toolkit fuzzy inference system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: get_mf_index_and_hedge.m -## Last-Modified: 12 Nov 2011 +## Last-Modified: 20 Aug 2012 -function [mf_index hedge not_flag] = get_mf_index_and_hedge (mf_index_and_hedge) +function [mf_index hedge not_flag] = ... + get_mf_index_and_hedge (mf_index_and_hedge) - ## Set flag to handle "not", indicated by a minus sign in the antecedent. + ## Set flag to handle "not", indicated by a minus sign in the + ## antecedent. if (mf_index_and_hedge < 0) not_flag = true; @@ -55,9 +57,10 @@ mf_index = fix (mf_index_and_hedge); ## For custom hedges and the four built-in hedges "somewhat", "very", - ## "extremely", and "very very", return the power to which the membership - ## value should be raised. The hedges are indicated by the fractional - ## part of the corresponding rule_matrix entry (rounded to 2 digits). + ## "extremely", and "very very", return the power to which the + ## membership value should be raised. The hedges are indicated by the + ## fractional part of the corresponding rule_matrix entry (rounded to + ## 2 digits). if (mf_index != 0) hedge = round (100 * (mf_index_and_hedge - mf_index)) / 10; Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_builtin_language.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_builtin_language.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_builtin_language.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_domain.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_domain.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_domain.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_fis.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_fis.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_fis.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_format.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_format.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_format.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_grid_spec.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_grid_spec.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_grid_spec.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_input_matrix.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_input_matrix.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_input_matrix.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -29,11 +29,12 @@ ## Keywords: fuzzy-logic-toolkit fuzzy private parameter-test ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: is_input_matrix.m -## Last-Modified: 20 May 2011 +## Last-Modified: 20 Aug 2012 function y = is_input_matrix (x, fis) - if (!(ismatrix (x) && isreal (x) && (columns (x) == columns (fis.input)))) + if (!(ismatrix (x) && isreal (x) && ... + (columns (x) == columns (fis.input)))) y = 0; else y = 1; Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_int.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_int.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_int.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_io_struct.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_io_struct.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_io_struct.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_io_vector.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_io_vector.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_io_vector.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_index.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_index.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_index.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_struct.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_struct.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_struct.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_vector.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_vector.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_mf_vector.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_output_index.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_output_index.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_output_index.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_pos_int.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_pos_int.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_pos_int.m 2012-08-24 16:11:37 UTC (rev 10908) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 L. Markowsky <lm...@us...> +## Copyright (C) 2011-2012 L. Markowsky <lm...@us...> ## ## This file is part of the fuzzy-logic-toolkit. ## Modified: trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_real.m =================================================================== --- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/is_real.m 2012-08-24 15:45:12 UTC (rev 10907) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/priva... [truncated message content] |
From: <par...@us...> - 2012-08-24 15:45:23
|
Revision: 10907 http://octave.svn.sourceforge.net/octave/?rev=10907&view=rev Author: paramaniac Date: 2012-08-24 15:45:12 +0000 (Fri, 24 Aug 2012) Log Message: ----------- control: improve doc and argument checking Modified Paths: -------------- trunk/octave-forge/main/control/inst/arx.m Modified: trunk/octave-forge/main/control/inst/arx.m =================================================================== --- trunk/octave-forge/main/control/inst/arx.m 2012-08-24 09:33:05 UTC (rev 10906) +++ trunk/octave-forge/main/control/inst/arx.m 2012-08-24 15:45:12 UTC (rev 10907) @@ -22,6 +22,19 @@ ## @deftypefnx {Function File} {[@var{sys}, @var{x0}] =} arx (@var{dat}, @var{'na'}, @var{na}, @var{'nb'}, @var{nb}) ## Estimate ARX model using QR factorization. ## +## @iftex +## @tex +## $$ A(q) \\, y(t) = B(q) \\, u(t) \\, + \\, e(t) $$ +## @end tex +## @end iftex +## @ifnottex +## +## @example +## A(q) y(t) = B(q) u(t) + e(t) +## @end example +## +## @end ifnottex +## ## @strong{Inputs} ## @table @var ## @item dat @@ -58,6 +71,12 @@ ## @item 'nb' ## Order of the polynomial B(q)+1 and number of zeros+1. ## @var{nb} <= @var{na}. +## +## @item 'nk' +## Input-output delay specified as number of sampling instants. +## Scalar positive integer. This corresponds to a call to command +## @command{nkshift}, followed by padding the B polynomial with +## @var{nk} leading zeros. ## @end table ## ## @@ -118,16 +137,14 @@ key = lower (varargin{k}); val = varargin{k+1}; switch (key) - ## TODO: proper argument checking case "na" - na = val; + na = __check_n__ (val, "na"); case "nb" - nb = val; + nb = __check_n__ (val, "nb"); case "nk" - if (issample (val, 0) && fix (val) == val) # individual, channel-wise nk not supported yet - nk = val; - else - error ("arx: argument 'nk' must be a positive integer"); + nk = __check_n__ (val, "nk"); + if (! issample (val, 0)) + error ("arx: channel-wise 'nk' matrices not supported yet"); endif otherwise warning ("arx: invalid property name '%s' ignored", key); @@ -281,3 +298,12 @@ x = V * (S .\ (U' * b)); # U' is the conjugate transpose endfunction + + +function val = __check_n__ (val, str = "n") + + if (! is_real_matrix (val) || fix (val) != val) + error ("arx: argument '%s' must be a positive integer", str); + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpi...@us...> - 2012-08-24 09:33:12
|
Revision: 10906 http://octave.svn.sourceforge.net/octave/?rev=10906&view=rev Author: jpicarbajal Date: 2012-08-24 09:33:05 +0000 (Fri, 24 Aug 2012) Log Message: ----------- mechanics: Doc improvement. Bug fixes. Adding new functions Modified Paths: -------------- trunk/octave-forge/main/mechanics/DESCRIPTION trunk/octave-forge/main/mechanics/INDEX trunk/octave-forge/main/mechanics/NEWS trunk/octave-forge/main/mechanics/inst/core/forcematrix.m trunk/octave-forge/main/mechanics/inst/core/inertiamoment.m trunk/octave-forge/main/mechanics/inst/core/masscenter.m trunk/octave-forge/main/mechanics/inst/core/principalaxes.m Added Paths: ----------- trunk/octave-forge/main/mechanics/devel/ trunk/octave-forge/main/mechanics/inst/core/private/drawAxis3D.m trunk/octave-forge/main/mechanics/inst/core/rodmassmatrix.m Removed Paths: ------------- trunk/octave-forge/main/mechanics/inst/core/drawAxis3D.m Modified: trunk/octave-forge/main/mechanics/DESCRIPTION =================================================================== --- trunk/octave-forge/main/mechanics/DESCRIPTION 2012-08-24 02:56:21 UTC (rev 10905) +++ trunk/octave-forge/main/mechanics/DESCRIPTION 2012-08-24 09:33:05 UTC (rev 10906) @@ -1,6 +1,6 @@ Name: Mechanics -Version: 1.2.0 -Date: 2011-12-09 +Version: 1.3.0 +Date: 2012-24-08 Author: Juan Pablo Carbajal <car...@if...>, Johan Beke <joh...@ho...> Maintainer: Juan Pablo Carbajal <car...@if...>, Johan Beke <joh...@ho...> Title: Classical Mechanics & Structural Analysis Modified: trunk/octave-forge/main/mechanics/INDEX =================================================================== --- trunk/octave-forge/main/mechanics/INDEX 2012-08-24 02:56:21 UTC (rev 10905) +++ trunk/octave-forge/main/mechanics/INDEX 2012-08-24 09:33:05 UTC (rev 10906) @@ -10,19 +10,19 @@ principalaxes.m 3D Mechanics EAmatrix.m - RBequations_rot.m - RBexample.m - drawAxis3D.m mat2quat.m quat2mat.m quatconj.m quatprod.m quatvrot.m + rodmassmatrix.m + RBequations_rot.m + RBexample.m Molecular Dynamics + lennardjones + mdsim verletstep verletstep_boxed - mdsim - lennardjones 2D Structural analysis (statics) MSNForces PlotDiagrams Modified: trunk/octave-forge/main/mechanics/NEWS =================================================================== --- trunk/octave-forge/main/mechanics/NEWS 2012-08-24 02:56:21 UTC (rev 10905) +++ trunk/octave-forge/main/mechanics/NEWS 2012-08-24 09:33:05 UTC (rev 10906) @@ -1,13 +1,18 @@ Summary of important user-visible changes for releases of the mechanics package =============================================================================== -mechanics-1.2.X Release Date: XX Release Manager: Juan Pablo Carbajal +mechanics-1.3.0 Release Date: 2012-24-08 Release Manager: Juan Pablo Carbajal =============================================================================== -* Bug fixes - - masscenter.m +* Functions with bug fixes + masscenter +* Added functions + rodmassmatrix +* Removed functions + drawAxes3D is now a private function. + =============================================================================== mechanics-1.2.0 Release Date: 2011-10-16 Release Manager: Juan Pablo Carbajal =============================================================================== Deleted: trunk/octave-forge/main/mechanics/inst/core/drawAxis3D.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/core/drawAxis3D.m 2012-08-24 02:56:21 UTC (rev 10905) +++ trunk/octave-forge/main/mechanics/inst/core/drawAxis3D.m 2012-08-24 09:33:05 UTC (rev 10906) @@ -1,21 +0,0 @@ -%%copyright (c) 2011 Juan Pablocarbajal <car...@if...> -%% -%% This program is free software: youcan redistribute itand/or modify -%% it under the terms of the GNU General Public Licenseas publishedby -%% the Free Software Foundation, either version 3 of the License, or -%% any later version. -%% -%% This program is distributed in the hope that it willbe useful, -%% but WITHOUTaNY WARRANTY; without even the implied warranty of -%% MERCHANTABILITY or FITNESS FORa PARTICULAR PURPOSE. See the -%% GNU General Public License for more details. -%% -%% You should have receivedacopy of the GNU General Public License -%% along with this program. If not, see <http://www.gnu.org/licenses/>. - -function drawAxis3D (p,E,c) - for i=1:3 - l =[p; p+E(i,:)]; - line(l(:,1),l(:,2),l(:,3),'color',c(i,:),'linewidth',2); - end -end Modified: trunk/octave-forge/main/mechanics/inst/core/forcematrix.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/core/forcematrix.m 2012-08-24 02:56:21 UTC (rev 10905) +++ trunk/octave-forge/main/mechanics/inst/core/forcematrix.m 2012-08-24 09:33:05 UTC (rev 10906) @@ -1,5 +1,5 @@ %% Copyright (c) 2010 Juan Pablo Carbajal <car...@if...> -%% +%% %% This program is free software: you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by %% the Free Software Foundation, either version 3 of the License, or @@ -26,7 +26,7 @@ %% %% @item %% @var{A} is the a connectivity (adjacency) matrix expressed as a vector. That is, if -%% @var{M} is the complete NxN symmetric connectivity matrix, then +%% @var{M} is the complete NxN symmetric connectivity matrix, then %% @code{@var{A}= vech(@var{M})}. The diagonal of @var{M} is not used. The elements %% of A are indexes to the corresponding interaction force in @var{funcs}. For %% example, there are 3 points and points 2 and 3 interact with a force @@ -45,7 +45,7 @@ %% @itemize %% @item %% @var{F} is a Nxdim array of forces acting on each point. -%% +%% %% @item %% @var{D} is an array in the same format as @var{A} containing the euclidean %% distances between the points. @@ -57,17 +57,18 @@ %% @seealso{pointmassmesh, polyval, vech, sub2ind} %% @end deftypefn -function [F D] = forcematrix (pos, A, funcs) +function [F D dr] = forcematrix (pos, A, funcs) %% Argument parsing [N dim] = size(pos); - nA = numel(A); - + nA = numel(A); + % Relative position matrix dr = zeros (nA,dim); for ic = 1:dim dr(:,ic) = vech (bsxfun (@minus, pos(:,ic)', pos(:,ic))); end + % Distance vector D = sqrt (sum (dr.^2, 2)); % Versor @@ -77,15 +78,14 @@ funcs{end+1} = 0; nf = numel(funcs); A(A==0) = nf; - + %% pair to pair forces f = cellfun (@handleOpoly, {funcs{A}}.', mat2cell (D, ones(nA,1), 1)); f = repmat(f,1,dim) .* drhat; - + %% net force on p1 F = zeros (N,dim); - - %% FIXME avoid looping + aux = ones(1,N-1); p2 = sub2ind_tril (N, 2:N, aux); F(1,:) = sum (f(p2,:)); @@ -99,7 +99,7 @@ ndhalf = idx((p1+1):N); F(p1,:) = sum (f(ndhalf,:)) - sum (f(sthalf,:)); end - + endfunction function f = handleOpoly (y,x) @@ -154,7 +154,7 @@ % 3D %!test % Cube %! pos = [0 0 0; 1 0 0; 1 1 0; 0 1 0; ... -%! 0 0 1; 1 0 1; 1 1 1; 0 1 1;]; +%! 0 0 1; 1 0 1; 1 1 1; 0 1 1;]; %! A= [0;1;0;1;1;0;0;0; ... %! 0;1;0;0;1;0;0; ... %! 0;1;0;0;1;0; ... @@ -162,7 +162,7 @@ %! 0;1;0;1; ... %! 0;1;0; ... %! 0;1; ... -%! 0; ]; +%! 0; ]; %! funcs={[-1 1]}; %! [F D] = forcematrix (pos, A, funcs); %! assert (F, zeros(8,3), 1e-8); @@ -178,7 +178,7 @@ %!test % Cube 2 funcs %! pos = [0 0 0; 1 0 0; 1 1 0; 0 1 0; ... -%! 0 0 1; 1 0 1; 1 1 1; 0 1 1;]; +%! 0 0 1; 1 0 1; 1 1 1; 0 1 1;]; %! A= [0;1;0;1;2;0;0;0; ... %! 0;1;0;0;2;0;0; ... %! 0;1;0;0;2;0; ... @@ -186,7 +186,7 @@ %! 0;1;0;1; ... %! 0;1;0; ... %! 0;1; ... -%! 0; ]; +%! 0; ]; %! funcs={[-1 1], @(x)-x}; %! [F D] = forcematrix (pos, A, funcs); %! F_sb = [zeros(4,2) ones(4,1); ... @@ -201,4 +201,3 @@ %! 0;sqrt(1); ... %! 0]; %! assert (D, D_sb, 1e-8); - Modified: trunk/octave-forge/main/mechanics/inst/core/inertiamoment.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/core/inertiamoment.m 2012-08-24 02:56:21 UTC (rev 10905) +++ trunk/octave-forge/main/mechanics/inst/core/inertiamoment.m 2012-08-24 09:33:05 UTC (rev 10906) @@ -1,4 +1,4 @@ -%% Copyright (c) 2011 Juan Pablo Carbajal <car...@if...> +%% Copyright (c) 2011-2012 Juan Pablo Carbajal <car...@if...> %% %% This program is free software; you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by Modified: trunk/octave-forge/main/mechanics/inst/core/masscenter.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/core/masscenter.m 2012-08-24 02:56:21 UTC (rev 10905) +++ trunk/octave-forge/main/mechanics/inst/core/masscenter.m 2012-08-24 09:33:05 UTC (rev 10906) @@ -1,4 +1,4 @@ -%% Copyright (c) 2011 Juan Pablo Carbajal <car...@if...> +%% Copyright (c) 2011-2012 Juan Pablo Carbajal <car...@if...> %% %% This program is free software; you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by Modified: trunk/octave-forge/main/mechanics/inst/core/principalaxes.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/core/principalaxes.m 2012-08-24 02:56:21 UTC (rev 10905) +++ trunk/octave-forge/main/mechanics/inst/core/principalaxes.m 2012-08-24 09:33:05 UTC (rev 10906) @@ -21,6 +21,8 @@ ## axes of the shape. @var{l} is the second moment of area around the correspoding ## principal axis. @var{axes} is order from lower to higher @var{l}. ## +## @var{shape} can be defined by a polygon or by a piece-wise smooth shape. +## ## @seealso{inertiamoment, masscenter} ## @end deftypefn @@ -68,7 +70,7 @@ %! h = 1; b = 2; %! rectangle = [-b/2 -h/2; b/2 -h/2; b/2 h/2; -b/2 h/2]; %! [PA l] = principalaxes(rectangle); -%! assert ( [0 1; 1 0], PA, 1e-6); +%! assert ( [1 0; 0 1], PA, 1e-6); %! assert ([b*h^3; h*b^3]/12, l); %!demo @@ -78,7 +80,8 @@ %! [PAr l] = principalaxes(shapeR); %! [PA l] = principalaxes(shape); %! -%! cla +%! figure (1) +%! clf %! plot(shape(:,1),shape(:,2),'-k'); %! line([0 PA(1,1)],[0 PA(1,2)],'color','r'); %! line([0 PA(2,1)],[0 PA(2,2)],'color','b'); Copied: trunk/octave-forge/main/mechanics/inst/core/private/drawAxis3D.m (from rev 10905, trunk/octave-forge/main/mechanics/inst/core/drawAxis3D.m) =================================================================== --- trunk/octave-forge/main/mechanics/inst/core/private/drawAxis3D.m (rev 0) +++ trunk/octave-forge/main/mechanics/inst/core/private/drawAxis3D.m 2012-08-24 09:33:05 UTC (rev 10906) @@ -0,0 +1,21 @@ +%%copyright (c) 2011 Juan Pablocarbajal <car...@if...> +%% +%% This program is free software: youcan redistribute itand/or modify +%% it under the terms of the GNU General Public Licenseas publishedby +%% the Free Software Foundation, either version 3 of the License, or +%% any later version. +%% +%% This program is distributed in the hope that it willbe useful, +%% but WITHOUTaNY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FORa PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have receivedacopy of the GNU General Public License +%% along with this program. If not, see <http://www.gnu.org/licenses/>. + +function drawAxis3D (p,E,c) + for i=1:3 + l =[p; p+E(i,:)]; + line(l(:,1),l(:,2),l(:,3),'color',c(i,:),'linewidth',2); + end +end Added: trunk/octave-forge/main/mechanics/inst/core/rodmassmatrix.m =================================================================== --- trunk/octave-forge/main/mechanics/inst/core/rodmassmatrix.m (rev 0) +++ trunk/octave-forge/main/mechanics/inst/core/rodmassmatrix.m 2012-08-24 09:33:05 UTC (rev 10906) @@ -0,0 +1,113 @@ +%% Copyright (c) 2012 Juan Pablo Carbajal <car...@if...> +%% +%% This program is free software: you can redistribute it and/or modify +%% it under the terms of the GNU General Public License as published by +%% the Free Software Foundation, either version 3 of the License, or +%% any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program. If not, see <http://www.gnu.org/licenses/>. + +%% -*- texinfo -*- +%% @deftypefn {Function File} {[@var{J} @var{sigma}]= } rodmassmatrix (@var{sigma},@var{l}, @var{rho}) +%% Mass matrix of one dimensional rod in 3D. +%% +%% Let q be the configuration vector of the rod, with the first three elements of +%% q being the spatial coordinates (e.g. x,y,z) and the second three elements of +%% q the rotiational coordinates (e.g. Euler angles), then the kinetical energy +%% of the rod is given by +%% T = 1/2 (dqdt)^T kron(J,eye(3)) dqdt +%% +%% @var{sigma} is between 0 and 1. Corresponds to the point in the rod that is +%% being used to indicate the position of the rod in space. +%% If @var{sigma} is a string then the value corresponding to the center of mass +%% of the rod. This makes @var{J} a diagonal matrix. If @var{sigma} is a string +%% the return value of @var{sigma} corresponds to the value pointing to the +%% center of mass. +%% +%% @var{l} is the length of the rod. If omitted the rod has unit length. +%% +%% @var{rho} is a function handle to the density of the rod defined in the +%% interval 0,1. The integral of this density equals the mass and is stored in +%% @code{@var{J}(1,1)}. If omitted, the default is a uniform rod with unit mass. +%% +%% Run @code{demo rodmassmatrix} to see some examples. +%% +%% @end deftypefn + +function [J varargout] = rodmassmatrix(sigma, l = 1, dens = @(x)1) + + if ischar (sigma) + sigma = quadgk (@(x)x.*dens(x), 0,1); + end + + u = [-sigma*l (1-sigma)*l]; + + m = quadgk (@(x)dens(sigma+x/l), u(1),u(2))/l; + f = quadgk (@(x)dens(sigma+x/l).*x, u(1),u(2))/l; + iner_m = quadgk (@(x)dens(sigma+x/l).*x.^2, u(1),u(2))/l; + + J = [m f; f iner_m]; + + if nargout > 0 + varargout{1} = quadgk (@(x)x.*dens(x), 0,1); + end + +endfunction + +%!demo +%! barlen = 2; +%! [Jc, s] = rodmassmatrix (0, barlen); +%! +%! printf ("Inertia matrix from the extrema : \n") +%! disp (Jc) +%! printf ("Sigma value to calculate from center of mass : %g \n",s) +%! +%! J = rodmassmatrix (s); +%! printf ("Inertia matrix from the CoM : \n") +%! disp (J) +%! +%! J2 = rodmassmatrix ("com"); +%! tf = all((J2 == J)(:)); +%! disp (["Are J and J2 equal? " "no"*not(tf) "yes"*tf]) +%! +%! % ---------------------------------------------------------------------------- +%! % This example shows the calculations for rod of length 2. First we place one +%! % of its extrema in the origin. Then we use the value of sigma provided by +%! % the function to do the same calculation form the center of mass. + +%!demo +%! % A normalized density function +%! density = @(x) (0.5*ones(size(x)) + 10*(x<0.1)).*(x>=0 & x<=1)/1.5; +%! [Jc, s] = rodmassmatrix (0,1,density); +%! +%! printf ("Inertia matrix from the extrema : \n") +%! disp (Jc) +%! printf ("Sigma value to calculate from center of mass : %g \n",s) +%! J = rodmassmatrix (s,1,density); +%! +%! printf ("Inertia matrix from the CoM : \n") +%! disp (J) +%! +%! figure (1) +%! clf +%! x = linspace (0,1,100)'; +%! h = plot (x,density(x),'b-;density;'); +%! set (h,'linewidth',2) +%! axis tight +%! v = axis(); +%! hold on +%! h = plot ([s s],v([3 4]),'k-;CoM;'); +%! set (h, 'linewidth', 2); +%! hold off +%! axis auto +%! % ---------------------------------------------------------------------------- +%! % This example defines a density function with an accumulation of mass near +%! % one end of the rod. First we place one of its extrema in the origin. Then +%! % we use the value of sigma provided by the function to do the same +%! % calculation form the center of mass. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-24 02:56:27
|
Revision: 10905 http://octave.svn.sourceforge.net/octave/?rev=10905&view=rev Author: carandraug Date: 2012-08-24 02:56:21 +0000 (Fri, 24 Aug 2012) Log Message: ----------- xcorr2: improved texinfo Modified Paths: -------------- trunk/octave-forge/main/signal/inst/xcorr2.m Modified: trunk/octave-forge/main/signal/inst/xcorr2.m =================================================================== --- trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-24 02:45:33 UTC (rev 10904) +++ trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-24 02:56:21 UTC (rev 10905) @@ -22,34 +22,32 @@ ## Compute the 2D cross-correlation of matrices @var{a} and @var{b}. ## ## If @var{b} is not specified, it defaults to the same matrix as @var{a}, i.e., -## it's the same as @code{xcorr(@var{a}, @var{a})}. +## same as @code{xcorr(@var{a}, @var{a})}. ## ## The optional argument @var{scale}, defines the type of scaling applied to the -## cross-correlation matrix (defaults to "none"). Possible values are: -## @itemize @bullet -## @item "biased" +## cross-correlation matrix. Possible values are: ## +## @table @asis +## @item "none" (default) +## No scaling. +## +## @item "biased" ## Scales the raw cross-correlation by the maximum number of elements of @var{a} ## and @var{b} involved in the generation of any element of @var{c}. ## -## @item "none" -## No scaling (this is the default). -## ## @item "unbiased" -## ## Scales the raw correlation by dividing each element in the cross-correlation ## matrix by the number of products @var{a} and @var{b} used to generate that -## element +## element. ## ## @item "coeff" +## Normalizes the sequence dividing by the max of the cross-correlation, so that +## the largest cross-correlation element is 1. ## -## Normalizes the sequence so that the largest cross-correlation element is -## identically 1.0. -## ## @item "norm" -## ## Returns the normalized cross-correlation. -## @end itemize +## @end table +## ## @seealso{conv2, corr2, xcorr} ## @end deftypefn @@ -69,6 +67,7 @@ ## bias routines by Dave Cogdell (cog...@as...) ## optimized by Paul Kienzle (pki...@us...) + ## norm routine by Carnë Draug (car...@gm...) switch lower (biasflag) case {"none"} ## do nothing, it's all done This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-24 02:45:40
|
Revision: 10904 http://octave.svn.sourceforge.net/octave/?rev=10904&view=rev Author: carandraug Date: 2012-08-24 02:45:33 +0000 (Fri, 24 Aug 2012) Log Message: ----------- xcorr2: new option to normalize cross correlation Modified Paths: -------------- trunk/octave-forge/main/signal/NEWS trunk/octave-forge/main/signal/inst/xcorr2.m Modified: trunk/octave-forge/main/signal/NEWS =================================================================== --- trunk/octave-forge/main/signal/NEWS 2012-08-23 20:09:51 UTC (rev 10903) +++ trunk/octave-forge/main/signal/NEWS 2012-08-24 02:45:33 UTC (rev 10904) @@ -16,8 +16,11 @@ ** The function `rceps' was fixed to work correctly with odd-length inputs. ** Bugfix in `xcorr2' introduced in 1.1.2 that would not accept "none" as - sacle option. + scale option. + ** `xcorr2' accepts a new scale option, "norm", to return the normalized + cross correlation. + ** The following functions are new: movingrms schtrig clustersegment Modified: trunk/octave-forge/main/signal/inst/xcorr2.m =================================================================== --- trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-23 20:09:51 UTC (rev 10903) +++ trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-24 02:45:33 UTC (rev 10904) @@ -1,5 +1,6 @@ ## Copyright (C) 2000 Dave Cogdell <cog...@as...> ## Copyright (C) 2000 Paul Kienzle <pki...@us...> +## Copyright (C) 2012 Carnë Draug <car...@gm...> ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software @@ -31,6 +32,9 @@ ## Scales the raw cross-correlation by the maximum number of elements of @var{a} ## and @var{b} involved in the generation of any element of @var{c}. ## +## @item "none" +## No scaling (this is the default). +## ## @item "unbiased" ## ## Scales the raw correlation by dividing each element in the cross-correlation @@ -42,9 +46,9 @@ ## Normalizes the sequence so that the largest cross-correlation element is ## identically 1.0. ## -## @item "none" +## @item "norm" ## -## No scaling (this is the default). +## Returns the normalized cross-correlation. ## @end itemize ## @seealso{conv2, corr2, xcorr} ## @end deftypefn @@ -66,6 +70,8 @@ ## bias routines by Dave Cogdell (cog...@as...) ## optimized by Paul Kienzle (pki...@us...) switch lower (biasflag) + case {"none"} + ## do nothing, it's all done case {"biased"} c = c / ( min ([ma, mb]) * min ([na, nb]) ); case {"unbiased"} @@ -82,10 +88,14 @@ case {"coeff"} c = c/max(c(:))'; - case {"none"} - ## do nothing, it's all done + + case {"norm"} + a = conv2 (a.^2, ones (size (b))); + b = dot (b(:), b(:)); + c(:,:) = c(:,:) ./ sqrt (a(:,:) * b); + otherwise - error ("invalid type of scale %s", biasflag); + error ("xcorr2: invalid type of scale %s", biasflag); endswitch endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-23 20:09:57
|
Revision: 10903 http://octave.svn.sourceforge.net/octave/?rev=10903&view=rev Author: paramaniac Date: 2012-08-23 20:09:51 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: update news Modified Paths: -------------- trunk/octave-forge/main/control/NEWS Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-08-23 20:03:09 UTC (rev 10902) +++ trunk/octave-forge/main/control/NEWS 2012-08-23 20:09:51 UTC (rev 10903) @@ -11,6 +11,9 @@ moesp fft plot n4sid filter resample +** sensitivity + Added new function to compute and plot the sensitivity margin Ms. + ** feedback Fixed an argument check which caused false positive error messages. It was a copy-paste mistake affecting non-square systems. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-23 20:03:20
|
Revision: 10902 http://octave.svn.sourceforge.net/octave/?rev=10902&view=rev Author: paramaniac Date: 2012-08-23 20:03:09 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: add small formula to doc Modified Paths: -------------- trunk/octave-forge/main/control/inst/sensitivity.m Modified: trunk/octave-forge/main/control/inst/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-23 19:35:50 UTC (rev 10901) +++ trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-23 20:03:09 UTC (rev 10902) @@ -23,6 +23,19 @@ ## The quantity @var{Ms} is simply the inverse of the shortest ## distance from the Nyquist curve to the critical point -1. ## Reasonable values of @var{Ms} are in the range from 1.3 to 2. +## @iftex +## @tex +## $$ M_s = ||S(j\\omega)||_{\\infty} $$ +## @end tex +## @end iftex +## @ifnottex +## +## @example +## Ms = ||S(jw)|| +## inf +## @end example +## +## @end ifnottex ## If no output arguments are given, the critical distance 1/Ms ## is plotted on a Nyquist diagram. ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-23 19:35:56
|
Revision: 10901 http://octave.svn.sourceforge.net/octave/?rev=10901&view=rev Author: paramaniac Date: 2012-08-23 19:35:50 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: move sensitivity into place, update INDEX Modified Paths: -------------- trunk/octave-forge/main/control/INDEX Added Paths: ----------- trunk/octave-forge/main/control/inst/sensitivity.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/sensitivity.m Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-08-23 19:33:48 UTC (rev 10900) +++ trunk/octave-forge/main/control/INDEX 2012-08-23 19:35:50 UTC (rev 10901) @@ -73,6 +73,7 @@ margin nichols nyquist + sensitivity sigma Pole Placement place Deleted: trunk/octave-forge/main/control/devel/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 19:33:48 UTC (rev 10900) +++ trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 19:35:50 UTC (rev 10901) @@ -1,123 +0,0 @@ -## Copyright (C) 2012 Lukas F. Reichlin -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{L}) -## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C}) -## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) -## Return sensitivity margin @var{Ms}. -## The quantity @var{Ms} is simply the inverse of the shortest -## distance from the Nyquist curve to the critical point -1. -## Reasonable values of @var{Ms} are in the range from 1.3 to 2. -## If no output arguments are given, the critical distance 1/Ms -## is plotted on a Nyquist diagram. -## -## @strong{Inputs} -## @table @var -## @item L -## Open loop transfer function. -## @var{L} can be any type of LTI system, but it must be square. -## @item P -## Plant model. Any type of LTI system. -## @item C -## Controller model. Any type of LTI system. -## @item C1, C2, @dots{} -## If several controllers are specified, command @command{sensitivity} -## computes the sensitivity @var{Ms} for each of them in combination -## with plant @var{P}. -## @end table -## -## @strong{Outputs} -## @table @var -## @item Ms -## Sensitivity margin @var{Ms} as defined in [1]. -## Scalar value. -## If several controllers are specified, @var{Ms} becomes -## a row vector with as many entries as controllers. -## @item ws -## The frequency [rad/s] corresponding to the sensitivity peak. -## Scalar value. -## If several controllers are specified, @var{ws} becomes -## a row vector with as many entries as controllers. -## @end table -## -## @strong{Algorithm}@* -## Uses SLICOT AB13DD by courtesy of -## @uref{http://www.slicot.org, NICONET e.V.} -## -## @strong{References}@* -## [1] Astr@"om, K. and H@"agglund, T. (1995) -## PID Controllers: -## Theory, Design and Tuning, -## Second Edition. -## Instrument Society of America. -## -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: August 2012 -## Version: 0.1 - -function [ret, ws] = sensitivity (G, varargin) - - ## TODO: show nyquist diagram of L with circle - ## center (-1, 0) and radius equal to the - ## shortest distance 1/Ms, frequency w is - ## [Ms, w] = norm (S, inf) - - if (nargin == 0) - print_usage (); - elseif (nargin == 1) # L := G - L = G; - I = eye (size (L)); - S = feedback (I, L); # S = inv (I + L), S = feedback (I, L*-I, "+") - [Ms, ws] = norm (S, inf); - else # P := G, C := varargin - L = cellfun (@(C) G*C, varargin, "uniformoutput", false); - I = cellfun (@(L) eye (size (L)), L, "uniformoutput", false); - S = cellfun (@feedback, I, L, "uniformoutput", false); - [Ms, ws] = cellfun (@(S) norm (S, inf), S); - endif - - if (nargout == 0) - ## TODO: don't show entire Nyquist curve if critical distance becomes small on plot - if (length (Ms) > 1) - error ("sensitivity: plotting only works for a single controller"); - endif - if (iscell (L)) - L = L{1}; - endif - [H, w] = __frequency_response__ (L, [], false, 0, "ext"); - H = H(:); - re = real (H); - im = imag (H); - Hs = freqresp (L, ws); - res = real (Hs); - ims = imag (Hs); - plot (re, im, "b", [-1, res], [0, ims], "r") - axis ("equal") - xlim (__axis_margin__ (xlim)) - ylim (__axis_margin__ (ylim)) - grid ("on") - title (sprintf ("Sensitivity Ms = %g (at %g rad/s)", Ms, ws)) - xlabel ("Real Axis") - ylabel ("Imaginary Axis") - else - ret = Ms; - endif - -endfunction Copied: trunk/octave-forge/main/control/inst/sensitivity.m (from rev 10900, trunk/octave-forge/main/control/devel/sensitivity.m) =================================================================== --- trunk/octave-forge/main/control/inst/sensitivity.m (rev 0) +++ trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-23 19:35:50 UTC (rev 10901) @@ -0,0 +1,123 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{L}) +## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C}) +## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) +## Return sensitivity margin @var{Ms}. +## The quantity @var{Ms} is simply the inverse of the shortest +## distance from the Nyquist curve to the critical point -1. +## Reasonable values of @var{Ms} are in the range from 1.3 to 2. +## If no output arguments are given, the critical distance 1/Ms +## is plotted on a Nyquist diagram. +## +## @strong{Inputs} +## @table @var +## @item L +## Open loop transfer function. +## @var{L} can be any type of LTI system, but it must be square. +## @item P +## Plant model. Any type of LTI system. +## @item C +## Controller model. Any type of LTI system. +## @item C1, C2, @dots{} +## If several controllers are specified, command @command{sensitivity} +## computes the sensitivity @var{Ms} for each of them in combination +## with plant @var{P}. +## @end table +## +## @strong{Outputs} +## @table @var +## @item Ms +## Sensitivity margin @var{Ms} as defined in [1]. +## Scalar value. +## If several controllers are specified, @var{Ms} becomes +## a row vector with as many entries as controllers. +## @item ws +## The frequency [rad/s] corresponding to the sensitivity peak. +## Scalar value. +## If several controllers are specified, @var{ws} becomes +## a row vector with as many entries as controllers. +## @end table +## +## @strong{Algorithm}@* +## Uses SLICOT AB13DD by courtesy of +## @uref{http://www.slicot.org, NICONET e.V.} +## +## @strong{References}@* +## [1] Astr@"om, K. and H@"agglund, T. (1995) +## PID Controllers: +## Theory, Design and Tuning, +## Second Edition. +## Instrument Society of America. +## +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: August 2012 +## Version: 0.1 + +function [ret, ws] = sensitivity (G, varargin) + + ## TODO: show nyquist diagram of L with circle + ## center (-1, 0) and radius equal to the + ## shortest distance 1/Ms, frequency w is + ## [Ms, w] = norm (S, inf) + + if (nargin == 0) + print_usage (); + elseif (nargin == 1) # L := G + L = G; + I = eye (size (L)); + S = feedback (I, L); # S = inv (I + L), S = feedback (I, L*-I, "+") + [Ms, ws] = norm (S, inf); + else # P := G, C := varargin + L = cellfun (@(C) G*C, varargin, "uniformoutput", false); + I = cellfun (@(L) eye (size (L)), L, "uniformoutput", false); + S = cellfun (@feedback, I, L, "uniformoutput", false); + [Ms, ws] = cellfun (@(S) norm (S, inf), S); + endif + + if (nargout == 0) + ## TODO: don't show entire Nyquist curve if critical distance becomes small on plot + if (length (Ms) > 1) + error ("sensitivity: plotting only works for a single controller"); + endif + if (iscell (L)) + L = L{1}; + endif + [H, w] = __frequency_response__ (L, [], false, 0, "ext"); + H = H(:); + re = real (H); + im = imag (H); + Hs = freqresp (L, ws); + res = real (Hs); + ims = imag (Hs); + plot (re, im, "b", [-1, res], [0, ims], "r") + axis ("equal") + xlim (__axis_margin__ (xlim)) + ylim (__axis_margin__ (ylim)) + grid ("on") + title (sprintf ("Sensitivity Ms = %g (at %g rad/s)", Ms, ws)) + xlabel ("Real Axis") + ylabel ("Imaginary Axis") + else + ret = Ms; + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-23 19:34:00
|
Revision: 10900 http://octave.svn.sourceforge.net/octave/?rev=10900&view=rev Author: paramaniac Date: 2012-08-23 19:33:48 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: finish function sensitivity Modified Paths: -------------- trunk/octave-forge/main/control/devel/sensitivity.m trunk/octave-forge/main/control/inst/sigma.m Modified: trunk/octave-forge/main/control/devel/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 17:54:14 UTC (rev 10899) +++ trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 19:33:48 UTC (rev 10900) @@ -16,13 +16,15 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn{Function File} {@var{Ms} =} sensitivity (@var{L}) -## @deftypefnx{Function File} {@var{Ms} =} sensitivity (@var{P}, @var{C}) -## @deftypefnx{Function File} {@var{Ms} =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) -## Return sensitivity margin @var{Ms}. The quantity @var{Ms} is -## simply the inverse of the shortest distance from the Nyquist -## curve to the critical point -1. Reasonable values of @var{Ms} -## are in the range from 1.3 to 2. +## @deftypefn{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{L}) +## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C}) +## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) +## Return sensitivity margin @var{Ms}. +## The quantity @var{Ms} is simply the inverse of the shortest +## distance from the Nyquist curve to the critical point -1. +## Reasonable values of @var{Ms} are in the range from 1.3 to 2. +## If no output arguments are given, the critical distance 1/Ms +## is plotted on a Nyquist diagram. ## ## @strong{Inputs} ## @table @var @@ -42,9 +44,15 @@ ## @strong{Outputs} ## @table @var ## @item Ms -## Sensitivity margin @var{Ms} as defined in [1]. Scalar value. +## Sensitivity margin @var{Ms} as defined in [1]. +## Scalar value. ## If several controllers are specified, @var{Ms} becomes -## a vector with as many entries as controllers. +## a row vector with as many entries as controllers. +## @item ws +## The frequency [rad/s] corresponding to the sensitivity peak. +## Scalar value. +## If several controllers are specified, @var{ws} becomes +## a row vector with as many entries as controllers. ## @end table ## ## @strong{Algorithm}@* @@ -64,7 +72,7 @@ ## Created: August 2012 ## Version: 0.1 -function Ms = sensitivity (G, varargin) +function [ret, ws] = sensitivity (G, varargin) ## TODO: show nyquist diagram of L with circle ## center (-1, 0) and radius equal to the @@ -74,14 +82,42 @@ if (nargin == 0) print_usage (); elseif (nargin == 1) # L := G - I = eye (size (G)); - S = feedback (I, G); # S = inv (I + G), S = feedback (I, G*-I, "+") - Ms = norm (S, inf); + L = G; + I = eye (size (L)); + S = feedback (I, L); # S = inv (I + L), S = feedback (I, L*-I, "+") + [Ms, ws] = norm (S, inf); else # P := G, C := varargin L = cellfun (@(C) G*C, varargin, "uniformoutput", false); I = cellfun (@(L) eye (size (L)), L, "uniformoutput", false); S = cellfun (@feedback, I, L, "uniformoutput", false); - Ms = cellfun (@(S) norm (S, inf), S); + [Ms, ws] = cellfun (@(S) norm (S, inf), S); endif + if (nargout == 0) + ## TODO: don't show entire Nyquist curve if critical distance becomes small on plot + if (length (Ms) > 1) + error ("sensitivity: plotting only works for a single controller"); + endif + if (iscell (L)) + L = L{1}; + endif + [H, w] = __frequency_response__ (L, [], false, 0, "ext"); + H = H(:); + re = real (H); + im = imag (H); + Hs = freqresp (L, ws); + res = real (Hs); + ims = imag (Hs); + plot (re, im, "b", [-1, res], [0, ims], "r") + axis ("equal") + xlim (__axis_margin__ (xlim)) + ylim (__axis_margin__ (ylim)) + grid ("on") + title (sprintf ("Sensitivity Ms = %g (at %g rad/s)", Ms, ws)) + xlabel ("Real Axis") + ylabel ("Imaginary Axis") + else + ret = Ms; + endif + endfunction Modified: trunk/octave-forge/main/control/inst/sigma.m =================================================================== --- trunk/octave-forge/main/control/inst/sigma.m 2012-08-23 17:54:14 UTC (rev 10899) +++ trunk/octave-forge/main/control/inst/sigma.m 2012-08-23 19:33:48 UTC (rev 10900) @@ -21,7 +21,7 @@ ## @deftypefnx{Function File} {[@var{sv}, @var{w}] =} sigma (@var{sys}, @var{[]}, @var{ptype}) ## @deftypefnx{Function File} {[@var{sv}, @var{w}] =} sigma (@var{sys}, @var{w}, @var{ptype}) ## Singular values of frequency response. If no output arguments are given, -## the singular value plot is printed on the screen; +## the singular value plot is printed on the screen. ## ## @strong{Inputs} ## @table @var This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-23 17:54:21
|
Revision: 10899 http://octave.svn.sourceforge.net/octave/?rev=10899&view=rev Author: carandraug Date: 2012-08-23 17:54:14 +0000 (Thu, 23 Aug 2012) Log Message: ----------- xcorr2: add simple test Modified Paths: -------------- trunk/octave-forge/main/signal/inst/xcorr2.m Modified: trunk/octave-forge/main/signal/inst/xcorr2.m =================================================================== --- trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-23 17:15:22 UTC (rev 10898) +++ trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-23 17:54:14 UTC (rev 10899) @@ -88,3 +88,15 @@ error ("invalid type of scale %s", biasflag); endswitch endfunction + +%!test +%! a = magic (5); +%! b = [6 13 22; 10 18 23; 8 15 23]; +%! c = [391 807 519 391 473 289 120 +%! 920 1318 1045 909 1133 702 278 +%! 995 1476 1338 1534 2040 1161 426 +%! 828 1045 1501 2047 2108 1101 340 +%! 571 1219 2074 2155 1896 821 234 +%! 473 1006 1643 1457 946 347 108 +%! 242 539 850 477 374 129 54]; +%! assert (xcorr2 (a, b), c); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |