From: <lm...@us...> - 2011-06-22 02:23:51
|
Revision: 8342 http://octave.svn.sourceforge.net/octave/?rev=8342&view=rev Author: lmarkov Date: 2011-06-22 01:50:32 +0000 (Wed, 22 Jun 2011) Log Message: ----------- M private/aggregate_output_sugeno.m M private/evalmf_private.m Modified Paths: -------------- trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_sugeno.m trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalmf_private.m 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 2011-06-19 12:41:27 UTC (rev 8341) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/aggregate_output_sugeno.m 2011-06-22 01:50:32 UTC (rev 8342) @@ -69,7 +69,7 @@ ## Keywords: fuzzy-logic-toolkit fuzzy fuzzy-inference-system fis ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: aggregate_output_sugeno.m -## Last-Modified: 19 May 2011 +## Last-Modified: 21 Jun 2011 ##------------------------------------------------------------------------------ @@ -87,7 +87,11 @@ aggregated_output = aggregate_fis_output (fis.aggMethod, unagg_output); next_agg_output = struct ('index', i, ... 'aggregated_output', aggregated_output); - retval = [retval, next_agg_output]; + if (i == 1) + retval = next_agg_output; + else + retval = [retval, next_agg_output]; + endif endfor endfunction @@ -135,7 +139,11 @@ y = []; for i = 1 : rows (x) if (x(i, 2) != 0) - y = [y; x(i, :)]; + if (isequal (y, [])) + y = x(i, :); + else + y = [y; x(i, :)]; + endif endif endfor endfunction 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 2011-06-19 12:41:27 UTC (rev 8341) +++ trunk/octave-forge/main/fuzzy-logic-toolkit/inst/private/evalmf_private.m 2011-06-22 01:50:32 UTC (rev 8342) @@ -30,7 +30,7 @@ ## Keywords: fuzzy-logic-toolkit fuzzy membership-function evaluate ## Directory: fuzzy-logic-toolkit/inst/private/ ## Filename: evalmf_private.m -## Last-Modified: 20 May 2011 +## Last-Modified: 21 Jun 2011 function y = evalmf_private (x, params, mf_type) @@ -54,7 +54,7 @@ function y = eval_constant (x, c) y = zeros (length (x)); delta = x(2) - x(1); - y_val = @(x_val) (abs (c - x_val) < delta); + y_val = @(x_val) ((abs (c - x_val) < delta) * 1); y = arrayfun (y_val, x); endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |