Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP2
octave-forge-fuzzy-logic-toolkit
inst-defuz.m-update-anonymous-funtion.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File inst-defuz.m-update-anonymous-funtion.diff of Package octave-forge-fuzzy-logic-toolkit
--- a/fuzzy-logic-toolkit/inst/defuzz.m +++ b/fuzzy-logic-toolkit/inst/defuzz.m @@ -1,4 +1,4 @@ -## Copyright (C) 2011-2014 L. Markowsky <lmarkov@users.sourceforge.net> +## Copyright (C) 2011-2018 L. Markowsky <lmarkov@users.sourceforge.net> ## ## This file is part of the fuzzy-logic-toolkit. ## @@ -162,7 +162,16 @@ function crisp_x = mom (x, y) max_y = max (y); - y_val = @(y_val) if (y_val == max_y) 1 else 0 endif; + + function y_val = calc_yval(y_val) + if (y_val == max_y) + y_val = 1; + else + y_val = 0; + endif + endfunction + + y_val = @(y_val) calc_yval(y_val); max_y_locations = arrayfun (y_val, y); crisp_x = sum (x .* max_y_locations) / sum (max_y_locations); @@ -185,7 +194,16 @@ function crisp_x = som (x, y) max_y = max (y); - y_val = @(y_val) if (y_val == max_y) 1 else (NaN) endif; + + function y_val = calc_yval(y_val) + if (y_val == max_y) + y_val = 1; + else + y_val = (NaN); + endif + endfunction + + y_val = @(y_val) calc_yval(y_val); max_y_locations = arrayfun (y_val, y); crisp_x = min (x .* max_y_locations); @@ -207,7 +225,16 @@ function crisp_x = lom (x, y) max_y = max (y); - y_val = @(y_val) if (y_val == max_y) 1 else (NaN) endif; + + function y_val = calc_yval(y_val) + if (y_val == max_y) + y_val = 1; + else + y_val = (NaN); + endif + endfunction + + y_val = @(y_val) calc_yval(y_val); max_y_locations = arrayfun (y_val, y); crisp_x = max (x .* max_y_locations);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor