├── +helper ├── addShortcuts.m ├── createSim.m ├── evalMfTypeHelper.m ├── isInt.m └── rulet2.m ├── .gitignore ├── COPYING.txt ├── Examples ├── 3_1_MatlabApplicationExample │ ├── fruits.jpg │ ├── imageProcessing.t2fis │ └── runEdgeDetectionExample.m ├── 3_2_ControlSystemsExample │ ├── IT2_FPID.t2fis │ ├── IT2_FPID_Controller.slx │ ├── IT2_FPID_Controller.slxc │ ├── runControlSystemExample.m │ └── slprj │ │ └── sim │ │ └── varcache │ │ └── IT2_FPID_Controller │ │ ├── checksumOfCache.mat │ │ ├── tmwinternal │ │ └── simulink_cache.xml │ │ └── varInfo.mat ├── ExampleFiles │ ├── BMM_FPID.t2fis │ ├── WuTest.t2fis │ ├── WuTest2.t2fis │ ├── bmmm.t2fis │ ├── test.t2fis │ ├── test2.t2fis │ └── test5.t2fis └── Toolbox_Test │ ├── Test4Input.fis │ ├── Test4Input2.t2fis │ ├── Type2FuzzyLogicSystems.slx │ └── t2f_test.m ├── Images ├── InputMF.jpg └── MemberShip.jpg ├── README.md ├── Read_Eval_Functions ├── evalt2.m ├── readt2fis.m ├── t2f_TR_BMM.m ├── t2f_TR_EIASC.m ├── t2f_TR_EKM.m ├── t2f_TR_EODS.m ├── t2f_TR_IASC.m ├── t2f_TR_KM.m ├── t2f_TR_NT.m └── t2f_TR_WM.m ├── Simulink_Lib ├── Fuzzy_Type2_Lib.mdl.r2012b ├── Fuzzy_Type2_Lib.slx ├── MemberShipMask.jpg ├── Type2FuzzyLogicSystems_grt_rtw │ ├── Type2FuzzyLogicSystems.rtw │ ├── build_exception.mat │ └── tlc │ │ ├── Type2FuzzyLogicSystems_aux.tlc │ │ ├── Type2FuzzyLogicSystems_codeIRInfo.tlc │ │ ├── codeIRInfo.mat │ │ ├── s0_b0_5egds_Functions.tlc │ │ ├── s0_b0_5egds_InitializeConditions.tlc │ │ ├── s0_b0_5egds_Outputs.tlc │ │ └── s0_b0_5egds_TLCInterface.tlc ├── slblocks.m └── slprj │ ├── grt │ └── Type2FuzzyLogicSystems │ │ └── tmwinternal │ │ └── minfo.mat │ └── sl_proj.tmw ├── fuzzyt2.m └── test.t2fis /+helper/addShortcuts.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function addShortcuts() 14 | evalstr = ['run(''',which('fuzzyt2'),''');']; 15 | categ='Type 2 Toolbox'; 16 | 17 | ShortcutUtils = com.mathworks.mlwidgets.shortcuts.ShortcutUtils; 18 | Shortcut_names = char(ShortcutUtils.getShortcutsByCategory(categ)); 19 | if ~isempty(Shortcut_names) 20 | Shortcut_names = regexp(Shortcut_names(2:end-1),', ','split'); 21 | end 22 | 23 | if isempty(Shortcut_names) || ~ismember('Fuzzy Type 2 Toolbox',Shortcut_names) 24 | ShortcutUtils.addShortcutToBottom('Fuzzy Type 2 Toolbox',... 25 | evalstr, which('MemberShip.jpg'), categ, 'true'); 26 | end -------------------------------------------------------------------------------- /+helper/createSim.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function createSim(fileName,pathName) 14 | % Open simulink 15 | simulink; 16 | 17 | % Specify the name of the model to create 18 | prompt={'Simulink file name:'}; 19 | name='T2FIS'; 20 | numlines=1; 21 | defaultanswer={'My_Interval_Type_2_Model'}; 22 | answer=inputdlg(prompt,name,numlines,defaultanswer); 23 | drawnow; 24 | try 25 | fname = answer{1}; 26 | catch 27 | return; 28 | end 29 | % Check if the file already exists and delete it if it does 30 | if exist(fname,'file') == 4 31 | % If it does then check whether it's open 32 | if bdIsLoaded(fname) 33 | % If it is then close it (without saving!) 34 | close_system(fname,0) 35 | end 36 | % delete the file 37 | delete([fname,'.slx']); 38 | end 39 | 40 | %% Load t2fis 41 | if nargin==0 42 | hFig = findall(0,'tag','fuzzyt2'); 43 | t2fis=helper.getAppdata; 44 | else 45 | t2fis=readt2fis(fileName,pathName); 46 | end 47 | assignin('base', 't2fisSim', t2fis) 48 | % Create the system 49 | new_system(fname); 50 | save_system(fname); 51 | open(fname); 52 | % Get number of inputs 53 | nInputs=numel(t2fis.input); 54 | 55 | % % Add a subsystem 56 | % add_block('simulink/Ports & Subsystems/Subsystem', [fname,'/Interval Type-2 Fuzzy Logic Controller'],... 57 | % 'Position',[280 90 430 180]); 58 | % delete_line([fname '/Interval Type-2 Fuzzy Logic Controller'],'In1/1','Out1/1') 59 | 60 | % Add a mux 61 | add_block('simulink/Signal Routing/Mux', [fname,'/Mux'],... 62 | 'Position',[265 95 270 180],... 63 | 'inputs',num2str(nInputs)); 64 | 65 | for i=1:nInputs 66 | % Add a Sine Wave, making the sample time continuous 67 | add_block('built-in/Constant', [fname,'/Input ' num2str(i)],... 68 | 'Position', [140 15+70*i 170 45+70*i],... 69 | 'SampleTime','-1'); 70 | % if i>1 71 | % % Add Input to the Subsystem 72 | % add_block('simulink/Ports & Subsystems/In1', [fname,'/In' num2str(i)],... 73 | % 'Position', [140 15+70*i 170 45+70*i],... 74 | % 'SampleTime','0'); 75 | % end 76 | % Connect the input to the mux 77 | % add_line(fname,['Input ' num2str(i) '/1'],['Interval Type-2 Fuzzy Logic Controller/' num2str(i)]) 78 | add_line(fname,['Input ' num2str(i) '/1'],['Mux/' num2str(i)]) 79 | end 80 | 81 | 82 | % add_block('Simulink/User-Defined Functions/Interpreted MATLAB Function', [gcs,'/t2fis'],... 83 | % 'Position',[350 120 450 160],... 84 | % 'MATLABFcn','evalt2(u,t2fisSim)'); 85 | 86 | add_block('Fuzzy_Type2_Lib/Interval Type-2 Fuzzy Logic Controller', [fname,'/t2fis'],... 87 | 'Position',[350 120 450 160]); 88 | set_param([fname,'/t2fis'],'t2fisSim','t2fisSim') 89 | set_param([fname,'/t2fis'],'LinkStatus','inactive') 90 | set_param([fname,'/t2fis/t2fis'],'OutputDimensions','1') 91 | 92 | % Add a Display block 93 | add_block('built-in/Display', [fname,'/Display'],... 94 | 'Position',[550 120 610 160]); 95 | 96 | % Connect the gain and the Display 97 | add_line(fname,'Mux/1','t2fis/1') 98 | add_line(fname,'t2fis/1','Display/1') 99 | % add_line(fname,'Interval Type-2 Fuzzy Logic Controller/1','Display/1') 100 | % Set a couple of model parameters to eliminate warning messages 101 | set_param(fname,... 102 | 'Solver','FixedStepDiscrete',... 103 | 'FixedStep','0.1'); 104 | % Save the model 105 | save_system(fname); 106 | open(fname); -------------------------------------------------------------------------------- /+helper/evalMfTypeHelper.m: -------------------------------------------------------------------------------- 1 | function member = evalMfTypeHelper( type,input,mfParams ) 2 | switch type 3 | case 'gaussmf' 4 | member =gaussmf(input, mfParams); 5 | case 'zmf' 6 | member =zmf(input, mfParams); 7 | case 'trapmf' 8 | member =trapmf(input, mfParams); 9 | case 'trimf' 10 | member =trimf(input, mfParams); 11 | case 'sigmf' 12 | member =sigmf(input, mfParams); 13 | case 'smf' 14 | member =smf(input, mfParams); 15 | case 'psigmf' 16 | member =psigmf(input, mfParams); 17 | case 'pimf' 18 | member =pimf(input, mfParams); 19 | case 'gbellmf' 20 | member =gbellmf(input, mfParams); 21 | case 'gauss2mf' 22 | member =gauss2mf(input, mfParams); 23 | case 'dsigmf' 24 | member =dsigmf(input, mfParams); 25 | end 26 | end 27 | 28 | -------------------------------------------------------------------------------- /+helper/isInt.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function bout=isInt(x) 14 | bout=~( isempty(x) || ~isa(x,'double') || (round(x)~=x) ); -------------------------------------------------------------------------------- /+helper/rulet2.m: -------------------------------------------------------------------------------- 1 | function [it2fis]=rulet2(t2fis,inTxtRuleList) 2 | numInputs=length(t2fis.input); 3 | numOutputs=length(t2fis.output); 4 | 5 | index=find(inTxtRuleList==0); 6 | inTxtRuleList(index)=32*ones(size(index)); 7 | inTxtRuleList(all(inTxtRuleList'==32),:)=[]; 8 | 9 | inTxtRuleList2=inTxtRuleList; 10 | index=[find(inTxtRuleList2==','),... 11 | find(inTxtRuleList2=='#'),... 12 | find(inTxtRuleList2==':'),... 13 | find(inTxtRuleList2=='('),... 14 | find(inTxtRuleList2==')'),... 15 | find(inTxtRuleList2<0)]; 16 | inTxtRuleList2(index)=32*ones(size(index)); 17 | inTxtRuleList2(all(inTxtRuleList2'==32),:)=[]; 18 | inTxtRuleList2=char(inTxtRuleList2); 19 | numRules=size(inTxtRuleList2,1); 20 | ruleList=zeros(numRules,numInputs+numOutputs+2); 21 | for i=1:numRules 22 | str=['[' inTxtRuleList2(i,:) ']']; 23 | rule=eval(str,'[]'); 24 | ruleList(i,:)=rule; 25 | t2fis.rule(i).antecedent=ruleList(i, 1:numInputs); 26 | t2fis.rule(i).consequent=ruleList(i, (numInputs+1):(numInputs+numOutputs)); 27 | t2fis.rule(i).weight=ruleList(i, numInputs+numOutputs+1); 28 | t2fis.rule(i).connection=ruleList(i, numInputs+numOutputs+2); 29 | end 30 | it2fis=t2fis; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/.gitignore -------------------------------------------------------------------------------- /COPYING.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /Examples/3_1_MatlabApplicationExample/fruits.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Examples/3_1_MatlabApplicationExample/fruits.jpg -------------------------------------------------------------------------------- /Examples/3_1_MatlabApplicationExample/imageProcessing.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='imageProcessing2' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=2 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='Karnik-Mendel' 14 | 15 | [Input1] 16 | Name='Ix' 17 | Range=[-1 1] 18 | NumMFs=1 19 | MF1U='IxU':'gaussmf',[0.1 0 1] 20 | MF1L='IxL':'gaussmf',[0.1 0 0.5] 21 | 22 | [Input2] 23 | Name='Iy' 24 | Range=[-1 1] 25 | NumMFs=1 26 | MF1U='IyU':'gaussmf',[0.1 0 1] 27 | MF1L='IyL':'gaussmf',[0.1 0 0.5] 28 | 29 | [Output1] 30 | Name='out' 31 | CrispInterval='crisp' 32 | Range=[-1 1] 33 | NumMFs=2 34 | MF1='black':'constant',[1 1] 35 | MF2='white':'constant',[0 0] 36 | 37 | [Rules] 38 | 1 1, 1 (1) : 1 39 | -1 -1, 2 (1) : 1 40 | -------------------------------------------------------------------------------- /Examples/3_1_MatlabApplicationExample/runEdgeDetectionExample.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | Irgb = imread('fruits.jpg'); 14 | Igray = 0.2989*Irgb(:,:,1)+0.5870*Irgb(:,:,2)+0.1140*Irgb(:,:,3); 15 | figure 16 | image(Igray,'CDataMapping','scaled'); 17 | colormap('gray') 18 | title('Input Image in Grayscale') 19 | % 20 | % figure 21 | % image(Igray,'CDataMapping','scaled'); 22 | % colormap('gray') 23 | % title('Input Image in Grayscale') 24 | 25 | %% Define Type Reduction Method 26 | % TRMethod='KM' -> 1, 'EKM'-> 2, 'IASC' -> 3, 'EIASC' -> 4, 'EODS' -> 5, 'WM' -> 6, 'NT' -> 7, 'BMM' -> 8 27 | TRMethod = 1; 28 | 29 | %% 30 | I = double(Igray); 31 | % 32 | classType = class(Igray); 33 | scalingFactor = double(intmax(classType)); 34 | I = I/scalingFactor; 35 | % 36 | Gx = [-1 1]; 37 | Gy = Gx'; 38 | Ix = conv2(I,Gx,'same'); 39 | Iy = conv2(I,Gy,'same'); 40 | % 41 | figure 42 | image(Ix,'CDataMapping','scaled') 43 | colormap('gray') 44 | title('Ix') 45 | 46 | figure 47 | image(Iy,'CDataMapping','scaled') 48 | colormap('gray') 49 | title('Iy') 50 | 51 | t2fis=readt2fis('imageProcessing.t2fis'); 52 | 53 | Ieval = zeros(size(I)); 54 | for ii = 1:size(I,1) 55 | disp(ii); 56 | for jj = 1:length(I) 57 | Ieval(ii,jj) = evalt2([(Ix(ii,jj));(Iy(ii,jj));]',t2fis,TRMethod); 58 | end 59 | end 60 | 61 | figure 62 | image(I,'CDataMapping','scaled') 63 | colormap('gray') 64 | title('Original Grayscale Image') 65 | 66 | figure 67 | image(Ieval,'CDataMapping','scaled') 68 | colormap('gray') 69 | title('Edge Detection Using Fuzzy Logic') 70 | 71 | 72 | -------------------------------------------------------------------------------- /Examples/3_2_ControlSystemsExample/IT2_FPID.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='TezTest' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=9 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='Karnik-Mendel' 14 | outputType='interval' 15 | 16 | [Input1] 17 | Name='input1' 18 | Range=[-1 1] 19 | NumMFs=3 20 | MF1U='mf1U':'trimf',[-1.8 -1 0 1] 21 | MF1L='mf1L':'trimf',[-1.6 -1 0 0.3] 22 | MF2U='mf2U':'trimf',[-1 0 1 1] 23 | MF2L='mf2L':'trimf',[-1 0 1 0.9] 24 | MF3U='mf3U':'trimf',[0 1 1.8 1] 25 | MF3L='mf3L':'trimf',[0 1 1.6 0.3] 26 | 27 | [Input2] 28 | Name='input2' 29 | Range=[-1 1] 30 | NumMFs=3 31 | MF1U='mf1U':'trimf',[-1.8 -1 0 1] 32 | MF1L='mf1L':'trimf',[-1.6 -1 0 0.3] 33 | MF2U='mf2U':'trimf',[-1 0 1 1] 34 | MF2L='mf2L':'trimf',[-1 0 1 0.9] 35 | MF3U='mf3U':'trimf',[0 1 1.8 1] 36 | MF3L='mf3L':'trimf',[0 1 1.8 0.3] 37 | 38 | [Output1] 39 | Name='output1' 40 | Range=[-1 1] 41 | NumMFs=5 42 | MF1='mf1':'constant',[-1 -1] 43 | MF2='mf2':'constant',[-0.8 -0.8] 44 | MF3='mf3':'constant',[0 0] 45 | MF4='mf4':'constant',[0.8 0.8] 46 | MF5='mf5':'constant',[1 1] 47 | 48 | [Rules] 49 | 1 1, 1 (1) : 1 50 | 1 2, 2 (1) : 1 51 | 1 3, 3 (1) : 1 52 | 2 1, 2 (1) : 1 53 | 2 2, 3 (1) : 1 54 | 2 3, 4 (1) : 1 55 | 3 1, 3 (1) : 1 56 | 3 2, 4 (1) : 1 57 | 3 3, 5 (1) : 1 58 | -------------------------------------------------------------------------------- /Examples/3_2_ControlSystemsExample/IT2_FPID_Controller.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Examples/3_2_ControlSystemsExample/IT2_FPID_Controller.slx -------------------------------------------------------------------------------- /Examples/3_2_ControlSystemsExample/IT2_FPID_Controller.slxc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Examples/3_2_ControlSystemsExample/IT2_FPID_Controller.slxc -------------------------------------------------------------------------------- /Examples/3_2_ControlSystemsExample/runControlSystemExample.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | %% Simulation parameters 14 | t2fisSim = readt2fis('IT2_FPID.t2fis'); 15 | Ke=1; 16 | Kd=0.5141; 17 | Ka=0.077; 18 | Kb=7.336; 19 | SamplingTime=0.05; 20 | 21 | %% System parameters 22 | K=1; 23 | T=1.1; 24 | L=0.3; 25 | 26 | open_system('IT2_FPID_Controller.slx') 27 | T2Controller=find_system('IT2_FPID_Controller','name',... 28 | 'Interval Type-2 Fuzzy PID'); 29 | T2Controller=[T2Controller{1} '/Interval Type-2 Fuzzy PID']; 30 | 31 | 32 | %% TR Method -> KM 33 | set_param(T2Controller,'TRtype','1'); 34 | sim('IT2_FPID_Controller.slx'); 35 | y_KM=y.signals.values; 36 | u_KM=u.signals.values; 37 | 38 | %% TR Method -> EKM 39 | set_param(T2Controller,'TRtype','2'); 40 | sim('IT2_FPID_Controller.slx'); 41 | y_EKM=y.signals.values; 42 | u_EKM=u.signals.values; 43 | 44 | 45 | %% TR Method -> WM 46 | set_param(T2Controller,'TRtype','6'); 47 | sim('IT2_FPID_Controller.slx'); 48 | y_WM=y.signals.values; 49 | u_WM=u.signals.values; 50 | 51 | 52 | %% TR Method -> NT 53 | set_param(T2Controller,'TRtype','8'); 54 | sim('IT2_FPID_Controller.slx'); 55 | y_NT=y.signals.values; 56 | u_NT=u.signals.values; 57 | 58 | 59 | 60 | %% Reference and time arrays 61 | ref=ref.signals.values; 62 | time=y.time; 63 | 64 | %% Plot figures 65 | figure; 66 | plot(time,ref,time,y_KM,time,y_EKM,time,y_WM,time,y_NT); 67 | legend('Reference','IT2-FPID-KM','IT2-FPID-EKM','IT2-FPID-WM','IT2-FPID-NT'); 68 | 69 | % figure; 70 | % plot(time,u_KM,time,u_WM,time,u_NT,time,u_IASC); 71 | % legend('IT2-FPID-KM','IT2-FPID-WM','IT2-FPID-NT','IT2-FPID-IASC'); -------------------------------------------------------------------------------- /Examples/3_2_ControlSystemsExample/slprj/sim/varcache/IT2_FPID_Controller/checksumOfCache.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Examples/3_2_ControlSystemsExample/slprj/sim/varcache/IT2_FPID_Controller/checksumOfCache.mat -------------------------------------------------------------------------------- /Examples/3_2_ControlSystemsExample/slprj/sim/varcache/IT2_FPID_Controller/tmwinternal/simulink_cache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /IBzYQFt86U3VD+lsNDycg== 5 | 6 | -------------------------------------------------------------------------------- /Examples/3_2_ControlSystemsExample/slprj/sim/varcache/IT2_FPID_Controller/varInfo.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Examples/3_2_ControlSystemsExample/slprj/sim/varcache/IT2_FPID_Controller/varInfo.mat -------------------------------------------------------------------------------- /Examples/ExampleFiles/BMM_FPID.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='deneme' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=9 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='BMM(0.9,0.3)' 14 | 15 | [Input1] 16 | Name='input1' 17 | Range=[-1 1] 18 | NumMFs=3 19 | MF1U='mf1U':'trimf',[-1.8 -1 0 1] 20 | MF1L='mf1L':'trimf',[-1.6 -1 0 0.3] 21 | MF2U='mf2U':'trimf',[-1 0 1 1] 22 | MF2L='mf2L':'trimf',[-1 0 1 0.9] 23 | MF3U='mf3U':'trimf',[0 1 1.8 1] 24 | MF3L='mf3L':'trimf',[0 1 1.6 0.3] 25 | 26 | [Input2] 27 | Name='input2' 28 | Range=[-1 1] 29 | NumMFs=3 30 | MF1U='mf1U':'trimf',[-1.8 -1 0 1] 31 | MF1L='mf1L':'trimf',[-1.6 -1 0 0.3] 32 | MF2U='mf2U':'trimf',[-1 0 1 1] 33 | MF2L='mf2L':'trimf',[-1 0 1 0.9] 34 | MF3U='mf3U':'trimf',[0 1 1.8 1] 35 | MF3L='mf3L':'trimf',[0 1 1.8 0.3] 36 | 37 | [Output1] 38 | Name='output1' 39 | CrispInterval='crisp' 40 | Range=[-1 1] 41 | NumMFs=5 42 | MF1='mf1':'constant',[-1 -1] 43 | MF2='mf2':'constant',[-0.8 -0.8] 44 | MF3='mf3':'constant',[0 0] 45 | MF4='mf4':'constant',[0.8 0.8] 46 | MF5='mf5':'constant',[1 1] 47 | 48 | [Rules] 49 | 1 1, 1 (1) : 1 50 | 1 2, 2 (1) : 1 51 | 1 3, 3 (1) : 1 52 | 2 1, 2 (1) : 1 53 | 2 2, 3 (1) : 1 54 | 2 3, 4 (1) : 1 55 | 3 1, 3 (1) : 1 56 | 3 2, 4 (1) : 1 57 | 3 3, 5 (1) : 1 58 | -------------------------------------------------------------------------------- /Examples/ExampleFiles/WuTest.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='WuTest' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=4 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='KM' 14 | 15 | [Input1] 16 | Name='input1' 17 | Range=[-1.5 1.5] 18 | NumMFs=2 19 | MF1U='mf1U':'trapmf',[-4.2 -1.8 -0.5 1.5 1] 20 | MF1L='mf1L':'trimf',[-4.5 -1.5 0.5 1] 21 | MF2U='mf2U':'trapmf',[-1.5 0.5 2 4.1 1] 22 | MF2L='mf2L':'trimf',[-0.5 1.5 4.5 1] 23 | 24 | [Input2] 25 | Name='input2' 26 | Range=[-1.5 1.5] 27 | NumMFs=2 28 | MF1U='mf1U':'trapmf',[-4.2 -1.8 -0.5 1.5 1] 29 | MF1L='mf1L':'trimf',[-4.5 -1.5 0.5 1] 30 | MF2U='mf2U':'trapmf',[-1.5 0.5 2 4.1 1] 31 | MF2L='mf2L':'trimf',[-0.5 1.5 4.5 1] 32 | 33 | [Output1] 34 | Name='output1' 35 | Range=[-1 1] 36 | NumMFs=4 37 | MF1='mf1':'constant',[-1 -0.9] 38 | MF2='mf2':'constant',[-0.6 -0.4] 39 | MF3='mf3':'constant',[0.4 0.6] 40 | MF4='mf4':'constant',[0.9 1] 41 | 42 | [Rules] 43 | 1 1, 1 (1) : 1 44 | 1 2, 2 (1) : 1 45 | 2 1, 3 (1) : 1 46 | 2 2, 4 (1) : 1 47 | -------------------------------------------------------------------------------- /Examples/ExampleFiles/WuTest2.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='WuTest2' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=4 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='KM' 14 | 15 | [Input1] 16 | Name='input1' 17 | Range=[-1.5 1.5] 18 | NumMFs=2 19 | MF1U='mf1U':'trapmf',[-4.2 -1.8 -0.5 1.5 1] 20 | MF1L='mf1L':'trimf',[-4.5 -1.5 0.5 1] 21 | MF2U='mf2U':'trapmf',[-1.5 0.5 2 4.1 1] 22 | MF2L='mf2L':'trimf',[-0.5 1.5 4.5 1] 23 | 24 | [Input2] 25 | Name='input2' 26 | Range=[-1.5 1.5] 27 | NumMFs=2 28 | MF1U='mf1U':'trapmf',[-4.2 -1.8 -0.5 1.5 1] 29 | MF1L='mf1L':'trimf',[-4.5 -1.5 0.5 1] 30 | MF2U='mf2U':'trapmf',[-1.5 0.5 2 4.1 1] 31 | MF2L='mf2L':'trimf',[-0.5 1.5 4.5 1] 32 | 33 | [Output1] 34 | Name='output1' 35 | CrispInterval='interval' 36 | Range=[-1 1] 37 | NumMFs=4 38 | MF1='mf1':'linear',[2 0 0 1 -1 -1] 39 | MF2='mf2':'constant',[-0.6 -0.4] 40 | MF3='mf3':'constant',[0.4 0.6] 41 | MF4='mf4':'constant',[0.9 1] 42 | 43 | [Rules] 44 | 1 1, 1 (1) : 1 45 | 1 2, 2 (1) : 1 46 | 2 1, 3 (1) : 1 47 | 2 2, 4 (1) : 1 48 | -------------------------------------------------------------------------------- /Examples/ExampleFiles/bmmm.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='deneme' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=4 6 | NumOutputs=1 7 | NumRules=6 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='BMM(0.9,0.3)' 14 | 15 | [Input1] 16 | Name='input1' 17 | Range=[0 1] 18 | NumMFs=3 19 | MF1U='mf1U':'trimf',[-0.5 0 0.5 1] 20 | MF1L='mf1L':'trimf',[-0.5 0 0.5 1] 21 | MF2U='mf2U':'trimf',[0 0.5 1 1] 22 | MF2L='mf2L':'trimf',[0 0.5 1 1] 23 | MF3U='mf3U':'trimf',[0.5 1 1.5 1] 24 | MF3L='mf3L':'trimf',[0.5 1 1.5 1] 25 | 26 | [Input2] 27 | Name='input2' 28 | Range=[0 1] 29 | NumMFs=3 30 | MF1U='mf1U':'trimf',[-0.5 0 0.5 1] 31 | MF1L='mf1L':'trimf',[-0.5 0 0.5 1] 32 | MF2U='mf2U':'trimf',[0 0.5 1 1] 33 | MF2L='mf2L':'trimf',[0 0.5 1 1] 34 | MF3U='mf3U':'trimf',[0.5 1 1.5 1] 35 | MF3L='mf3L':'trimf',[0.5 1 1.5 1] 36 | 37 | [Input3] 38 | Name='input3' 39 | Range=[0 1] 40 | NumMFs=3 41 | MF1U='mf1U':'trimf',[-0.5 0 0.5 1] 42 | MF1L='mf1L':'trimf',[-0.5 0 0.5 1] 43 | MF2U='mf2U':'trimf',[0 0.5 1 1] 44 | MF2L='mf2L':'trimf',[0 0.5 1 1] 45 | MF3U='mf3U':'trimf',[0.5 1 1.5 1] 46 | MF3L='mf3L':'trimf',[0.5 1 1.5 1] 47 | 48 | [Input4] 49 | Name='input4' 50 | Range=[0 1] 51 | NumMFs=3 52 | MF1U='mf1U':'trimf',[-0.5 0 0.5 1] 53 | MF1L='mf1L':'trimf',[-0.5 0 0.5 1] 54 | MF2U='mf2U':'trimf',[0 0.5 1 1] 55 | MF2L='mf2L':'trimf',[0 0.5 1 1] 56 | MF3U='mf3U':'trimf',[0.5 1 1.5 1] 57 | MF3L='mf3L':'trimf',[0.5 1 1.5 1] 58 | 59 | [Output1] 60 | Name='output1' 61 | CrispInterval='crisp' 62 | Range=[-1 1] 63 | NumMFs=3 64 | MF1='mf1':'constant',[-0.5345 -0.5345] 65 | MF2='mf2':'constant',[0.3223 0.3223] 66 | MF3='mf3':'constant',[0.4343 0.4343] 67 | 68 | [Rules] 69 | 1 1 1 1, 1 (1) : 1 70 | 2 2 3 2, 3 (1) : 1 71 | 3 1 3 1, 2 (1) : 1 72 | 2 2 1 3, 1 (1) : 1 73 | 3 1 3 1, 3 (1) : 1 74 | 2 3 2 2, 2 (1) : 1 75 | -------------------------------------------------------------------------------- /Examples/ExampleFiles/test.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='Test' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=4 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='KM' 14 | 15 | [Input1] 16 | Name='input1' 17 | Range=[-1.5 1.5] 18 | NumMFs=2 19 | MF1U='mf1U':'trapmf',[-4.2 -1.8 -0.5 1.5 1] 20 | MF1L='mf1L':'trimf',[-4.5 -1.5 0.5 1] 21 | MF2U='mf2U':'trapmf',[-1.5 0.5 2 4.1 1] 22 | MF2L='mf2L':'trimf',[-0.5 1.5 4.5 1] 23 | 24 | [Input2] 25 | Name='input2' 26 | Range=[-1.5 1.5] 27 | NumMFs=2 28 | MF1U='mf1U':'trapmf',[-4.2 -1.8 -0.5 1.5 1] 29 | MF1L='mf1L':'trimf',[-4.5 -1.5 0.5 1] 30 | MF2U='mf2U':'trapmf',[-1.5 0.5 2 4.1 1] 31 | MF2L='mf2L':'trimf',[-0.5 1.5 4.5 1] 32 | 33 | [Output1] 34 | Name='output1' 35 | Range=[-1 1] 36 | NumMFs=4 37 | MF1='mf1':'constant',[-1 -0.9] 38 | MF2='mf2':'constant',[-0.6 -0.4] 39 | MF3='mf3':'constant',[0.4 0.6] 40 | MF4='mf4':'constant',[0.9 1] 41 | 42 | [Rules] 43 | 1 1, 1 (1) : 1 44 | 1 2, 2 (1) : 1 45 | 2 1, 3 (1) : 1 46 | 2 2, 4 (1) : 1 47 | -------------------------------------------------------------------------------- /Examples/ExampleFiles/test2.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='test2' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=3 6 | NumOutputs=1 7 | NumRules=4 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='NT' 14 | outputType='interval' 15 | 16 | [Input1] 17 | Name='x1' 18 | Range=[-1 1] 19 | NumMFs=3 20 | MF1U='x1-N':'trimf',[-1.8 -1 -0.2 1] 21 | MF1L='x1-N':'trimf',[-1.6 -1 -0.4 0.7] 22 | MF2U='x1-Z':'trimf',[-0.8 0 0.8 1] 23 | MF2L='mf2L':'trimf',[-0.6 0 0.6 0.7] 24 | MF3U='x1-P':'trimf',[0.2 1 1.8 1] 25 | MF3L='mf3L':'trimf',[0.4 1 1.6 0.7] 26 | 27 | [Input2] 28 | Name='x2' 29 | Range=[-1 1] 30 | NumMFs=3 31 | MF1U='x2-N':'gaussmf',[0.4247 -1 1] 32 | MF1L='mf1L':'gaussmf',[0.21235 -1 0.5] 33 | MF2U='x2-Z':'gaussmf',[0.4247 0 1] 34 | MF2L='mf2L':'gaussmf',[0.21235 0 0.5] 35 | MF3U='x2-P':'gaussmf',[0.4247 1 1] 36 | MF3L='mf3L':'gaussmf',[0.21235 1 0.5] 37 | 38 | [Input3] 39 | Name='x3' 40 | Range=[-1 1] 41 | NumMFs=3 42 | MF1U='x3-N':'trapmf',[-1.9 -1.1 -0.9 -0.1 1] 43 | MF1L='mf1L':'gaussmf',[0.21235 -1 0.5] 44 | MF2U='x3-Z':'trapmf',[-0.9 -0.1 0.1 0.9 1] 45 | MF2L='mf2L':'gaussmf',[0.21235 0 0.5] 46 | MF3U='x3-P':'trapmf',[0.1 0.9 1.1 1.9 1] 47 | MF3L='mf3L':'gaussmf',[0.21235 1 0.5] 48 | 49 | [Output1] 50 | Name='output1' 51 | Range=[-1 1] 52 | NumMFs=3 53 | MF1='N':'constant',[-5 -5] 54 | MF2='Z':'constant',[0 0] 55 | MF3='P':'constant',[5 5] 56 | 57 | [Rules] 58 | 1 1 1, 1 (1) : 1 59 | 1 2 1, 3 (1) : 1 60 | 1 1 2, 3 (1) : 1 61 | 1 2 2, 2 (1) : 1 62 | -------------------------------------------------------------------------------- /Examples/ExampleFiles/test5.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='test5' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=3 6 | NumOutputs=1 7 | NumRules=4 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='NT' 14 | outputType='interval' 15 | 16 | [Input1] 17 | Name='x1' 18 | Range=[-1 1] 19 | NumMFs=3 20 | MF1U='x1-N':'trimf',[-1.8 -1 -0.2 1] 21 | MF1L='x1-N':'trimf',[-1.6 -1 -0.4 0.7] 22 | MF2U='x1-Z':'trimf',[-0.8 0 0.8 1] 23 | MF2L='mf2L':'trimf',[-0.6 0 0.6 0.7] 24 | MF3U='x1-P':'trimf',[0.2 1 1.8 1] 25 | MF3L='mf3L':'trimf',[0.4 1 1.6 0.7] 26 | 27 | [Input2] 28 | Name='x2' 29 | Range=[-1 1] 30 | NumMFs=3 31 | MF1U='x2-N':'gaussmf',[0.4247 -1 1] 32 | MF1L='mf1L':'gaussmf',[0.21235 -1 0.5] 33 | MF2U='x2-Z':'gaussmf',[0.4247 0 1] 34 | MF2L='mf2L':'gaussmf',[0.21235 0 0.5] 35 | MF3U='x2-P':'gaussmf',[0.4247 1 1] 36 | MF3L='mf3L':'gaussmf',[0.21235 1 0.5] 37 | 38 | [Input3] 39 | Name='x3' 40 | Range=[-1 1] 41 | NumMFs=3 42 | MF1U='x3-N':'trapmf',[-1.9 -1.1 -0.9 -0.1 1] 43 | MF1L='mf1L':'gaussmf',[0.21235 -1 0.5] 44 | MF2U='x3-Z':'trapmf',[-0.9 -0.1 0.1 0.9 1] 45 | MF2L='mf2L':'gaussmf',[0.21235 0 0.5] 46 | MF3U='x3-P':'trapmf',[0.1 0.9 1.1 1.9 1] 47 | MF3L='mf3L':'gaussmf',[0.21235 1 0.5] 48 | 49 | [Output1] 50 | Name='output1' 51 | Range=[-1 1] 52 | NumMFs=4 53 | MF1='N':'linear',[1 0 1 0 1 0 1 -5] 54 | MF2='Z':'linear',[1 0.5 1 0.5 1 0.5 1 0.5] 55 | MF3='P':'linear',[5 1 5 1 5 1 5 5] 56 | MF4='PM':'linear',[10 5 10 5 10 5 2 2] 57 | 58 | [Rules] 59 | 1 1 1, 1 (1) : 1 60 | 1 2 1, 3 (1) : 1 61 | 1 1 2, 4 (1) : 1 62 | 1 2 2, 2 (1) : 1 63 | -------------------------------------------------------------------------------- /Examples/Toolbox_Test/Test4Input.fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='Test4Input' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=4 6 | NumOutputs=1 7 | NumRules=6 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | 14 | [Input1] 15 | Name='input1' 16 | Range=[0 1] 17 | NumMFs=3 18 | MF1='mf1':'trimf',[-0.5 0 0.5] 19 | MF2='mf2':'trimf',[0 0.5 1] 20 | MF3='mf3':'trimf',[0.5 1 1.5] 21 | 22 | [Input2] 23 | Name='input2' 24 | Range=[0 1] 25 | NumMFs=3 26 | MF1='mf1':'trimf',[-0.5 0 0.5] 27 | MF2='mf2':'trimf',[0 0.5 1] 28 | MF3='mf3':'trimf',[0.5 1 1.5] 29 | 30 | [Input3] 31 | Name='input3' 32 | Range=[0 1] 33 | NumMFs=3 34 | MF1='mf1':'trimf',[-0.5 0 0.5] 35 | MF2='mf2':'trimf',[0 0.5 1] 36 | MF3='mf3':'trimf',[0.5 1 1.5] 37 | 38 | [Input4] 39 | Name='input4' 40 | Range=[0 1] 41 | NumMFs=3 42 | MF1='mf1':'trimf',[-0.5 0 0.5] 43 | MF2='mf2':'trimf',[0 0.5 1] 44 | MF3='mf3':'trimf',[0.5 1 1.5] 45 | 46 | [Output1] 47 | Name='output1' 48 | Range=[-5 5] 49 | NumMFs=3 50 | MF1='mf1':'constant',[-0.5345] 51 | MF2='mf2':'constant',[0.3223] 52 | MF3='mf3':'constant',[0.4343] 53 | 54 | [Rules] 55 | 1 1 1 1, 1 (1) : 1 56 | 2 2 3 2, 3 (1) : 1 57 | 3 1 3 1, 2 (1) : 1 58 | 2 2 1 3, 1 (1) : 1 59 | 3 1 3 1, 3 (1) : 1 60 | 2 3 2 2, 2 (1) : 1 61 | -------------------------------------------------------------------------------- /Examples/Toolbox_Test/Test4Input2.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='Test4Input2' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=4 6 | NumOutputs=1 7 | NumRules=6 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='Karnik-Mendel' 14 | 15 | [Input1] 16 | Name='input1' 17 | Range=[0 1] 18 | NumMFs=3 19 | MF1U='mf1U':'trimf',[-0.5 0 0.5 1] 20 | MF1L='mf1L':'trimf',[-0.5 0 0.5 1] 21 | MF2U='mf2U':'trimf',[0 0.5 1 1] 22 | MF2L='mf2L':'trimf',[0 0.5 1 1] 23 | MF3U='mf3U':'trimf',[0.5 1 1.5 1] 24 | MF3L='mf3L':'trimf',[0.5 1 1.5 1] 25 | 26 | [Input2] 27 | Name='input2' 28 | Range=[0 1] 29 | NumMFs=3 30 | MF1U='mf1U':'trimf',[-0.5 0 0.5 1] 31 | MF1L='mf1L':'trimf',[-0.5 0 0.5 1] 32 | MF2U='mf2U':'trimf',[0 0.5 1 1] 33 | MF2L='mf2L':'trimf',[0 0.5 1 1] 34 | MF3U='mf3U':'trimf',[0.5 1 1.5 1] 35 | MF3L='mf3L':'trimf',[0.5 1 1.5 1] 36 | 37 | [Input3] 38 | Name='input3' 39 | Range=[0 1] 40 | NumMFs=3 41 | MF1U='mf1U':'trimf',[-0.5 0 0.5 1] 42 | MF1L='mf1L':'trimf',[-0.5 0 0.5 1] 43 | MF2U='mf2U':'trimf',[0 0.5 1 1] 44 | MF2L='mf2L':'trimf',[0 0.5 1 1] 45 | MF3U='mf3U':'trimf',[0.5 1 1.5 1] 46 | MF3L='mf3L':'trimf',[0.5 1 1.5 1] 47 | 48 | [Input4] 49 | Name='input4' 50 | Range=[0 1] 51 | NumMFs=3 52 | MF1U='mf1U':'trimf',[-0.5 0 0.5 1] 53 | MF1L='mf1L':'trimf',[-0.5 0 0.5 1] 54 | MF2U='mf2U':'trimf',[0 0.5 1 1] 55 | MF2L='mf2L':'trimf',[0 0.5 1 1] 56 | MF3U='mf3U':'trimf',[0.5 1 1.5 1] 57 | MF3L='mf3L':'trimf',[0.5 1 1.5 1] 58 | 59 | [Output1] 60 | Name='output1' 61 | Range=[-1 1] 62 | NumMFs=3 63 | MF1='mf1':'constant',[-0.5345 -0.5345] 64 | MF2='mf2':'constant',[0.3223 0.3223] 65 | MF3='mf3':'constant',[0.4343 0.4343] 66 | 67 | [Rules] 68 | 1 1 1 1, 1 (1) : 1 69 | 2 2 3 2, 3 (1) : 1 70 | 3 1 3 1, 2 (1) : 1 71 | 2 2 1 3, 1 (1) : 1 72 | 3 1 3 1, 3 (1) : 1 73 | 2 3 2 2, 2 (1) : 1 74 | -------------------------------------------------------------------------------- /Examples/Toolbox_Test/Type2FuzzyLogicSystems.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Examples/Toolbox_Test/Type2FuzzyLogicSystems.slx -------------------------------------------------------------------------------- /Examples/Toolbox_Test/t2f_test.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function t2f_test() 14 | for i=1:100 15 | input = 0 + (0+1)*rand(4,1); 16 | input=input'; 17 | fis = readfis('Test4Input'); 18 | out(i,1) = evalfis(input,fis); 19 | 20 | fist2 = readt2fis('Test4Input2.t2fis'); 21 | out(i,2) = evalt2(input,fist2); 22 | end 23 | plot(out) 24 | 25 | % if out(:,1)==out(:,2) 26 | % disp('passed') 27 | % else 28 | % disp('failed') 29 | % end -------------------------------------------------------------------------------- /Images/InputMF.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Images/InputMF.jpg -------------------------------------------------------------------------------- /Images/MemberShip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Images/MemberShip.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Interval Type-2 Fuzzy Logic System Toolbox 2 | A Matlab/Simulink Library for the Interval Type-2 Fuzzy Logic Systems (IT2-FLS). The presented toolbox is presented in the following paper: 3 | 4 | Taskin, A. and Kumbasar, T., 2015. An open source Matlab/Simulink Toolbox for Interval Type-2 Fuzzy Logic Systems, IEEE Symposium Series on Computational Intelligence – SSCI 2015, Cape Town, South Africa. (draft version –final version) 5 | 6 | We kindly ask that to cite the above mentioned paper if you use IT2-FLS Matlab/Simulink Toolbox and you publish papers about work that was performed using IT2-FLS Matlab/Simulink Toolbox. 7 | 8 | # How to run IT2-FLS Toolbox 9 | Download or clone the repository into a convenient directory. 10 | Open MATLAB 2015a or a newer version. 11 | Then run "fuzzyt2.m" which locates at the root of project. 12 | 13 | # How to run examples in the repository 14 | 15 | The repositort includes 2 examples. First one is and edge detection of an image, the secon one is an control example by using an Interval Type-2 Fuzzy Logic controller. 16 | 17 | To run first example (Edge detection) 18 | - go to 'it2-fls-toolbox\Examples\3_1_MatlabAppicationExample' directory 19 | - run the 'runEdgeDetectionExample.m' m script. 20 | 21 | To run second example (control system) 22 | - go to 'it2-fls-toolbox\Examples\3_2_ControlSystemsExample' directory 23 | - run the 'runControlSystemExample.m' m script. 24 | -------------------------------------------------------------------------------- /Read_Eval_Functions/evalt2.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function y = evalt2 (input,t2fis,TRMethod) 14 | if nargin==0 15 | prompt={'T2FIS file:','Inputs:'}; 16 | name='EvalT2'; 17 | numlines=1; 18 | t2fispath=cellstr(ls('*.t2fis')); 19 | if isempty(t2fispath) 20 | t2fispath='*.t2fis'; 21 | else 22 | t2fispath=t2fispath{end,1}; 23 | end 24 | defaultanswer={t2fispath,'[-0.3 0.6]'}; 25 | answer=inputdlg(prompt,name,numlines,defaultanswer); 26 | drawnow; 27 | if isempty(answer) 28 | disp('User cancelled') 29 | return 30 | end 31 | inputUI=evalin('base',answer{2},'[]'); 32 | for i=1:numel(inputUI) 33 | input(1,i)=inputUI(i); 34 | end 35 | [path,~]=fileparts(which(answer{1})); 36 | t2fis=readt2fis(answer{1},path); 37 | % warning('function needs 2 input') 38 | % return 39 | end 40 | if nargin == 3 41 | try 42 | t2fisstruct=evalin('base',t2fis); 43 | catch me 44 | if isstruct(t2fis) 45 | t2fisstruct=t2fis; 46 | else 47 | if ~isempty(which(t2fis)) 48 | [path,~]=fileparts(which(t2fis)); 49 | t2fisstruct=readt2fis(t2fis,path); 50 | elseif ~isempty(which([t2fis '.t2fis'])) 51 | [path,~]=fileparts(which([t2fis '.t2fis'])); 52 | t2fisstruct=readt2fis([t2fis '.t2fis'],path); 53 | else 54 | end 55 | end 56 | end 57 | sizeInput = size(input); 58 | if length(input) > sizeInput(2) 59 | input=input'; 60 | end 61 | if ischar(TRMethod) 62 | TRMethod=str2num(TRMethod); 63 | end 64 | t2fis=t2fisstruct; 65 | 66 | if TRMethod==0 67 | TRMethod='KM'; 68 | elseif TRMethod==1 69 | t2fis.typeRedMethod='KM'; 70 | TRMethod='KM'; 71 | elseif TRMethod==2 72 | t2fis.typeRedMethod='EKM'; 73 | TRMethod='EKM'; 74 | elseif TRMethod==3 75 | t2fis.typeRedMethod='IASC'; 76 | TRMethod='IASC'; 77 | elseif TRMethod==4 78 | t2fis.typeRedMethod='EIASC'; 79 | TRMethod='EIASC'; 80 | elseif TRMethod==5 81 | t2fis.typeRedMethod='EODS'; 82 | TRMethod='EODS'; 83 | elseif TRMethod==6 84 | t2fis.typeRedMethod='WM'; 85 | TRMethod='WM'; 86 | elseif TRMethod==7 87 | t2fis.typeRedMethod='NT'; 88 | TRMethod='NT'; 89 | elseif TRMethod==8 90 | t2fis.typeRedMethod='BMM'; 91 | TRMethod='BMM'; 92 | elseif TRMethod==9 93 | t2fis.typeRedMethod='Custom'; 94 | end 95 | else 96 | TRMethod = t2fis.typeRedMethod; 97 | end 98 | rules = cat(1,t2fis.rule.antecedent); 99 | N = size(rules); 100 | NofRule = N(1); 101 | nInput = length(t2fis.input); 102 | [inputN, ~] = size(input); 103 | y = zeros(inputN,1); 104 | for inputSeq = 1:inputN 105 | F = zeros(NofRule,2); 106 | C = zeros(NofRule,1); 107 | x = input(inputSeq,:); 108 | %% ruleN = rule sayisi 109 | for n=1:NofRule 110 | f1U=1; 111 | f1L=1; 112 | for i=1:nInput 113 | % Calculate Lower firing 114 | if rules(n,i) > 0 115 | UpperParams = t2fis.input(i).mf(1,rules(n,i)).params; 116 | LowerParams = t2fis.input(i).mf(2,rules(n,i)).params; 117 | MemberUpper = UpperParams(end) * helper.evalMfTypeHelper(t2fis.input(i).mf(1,rules(n,i)).type,x(i),UpperParams(1:end-1)); 118 | MemberLower = LowerParams(end) * helper.evalMfTypeHelper(t2fis.input(i).mf(2,rules(n,i)).type,x(i),LowerParams(1:end-1)); 119 | %MemberUpper = UpperParams(end)*eval(['helper.' t2fis.input(i).mf(1,rules(n,i)).type '(x(i),UpperParams(1:end-1))']); 120 | %MemberLower = LowerParams(end)*eval(['helper.' t2fis.input(i).mf(2,rules(n,i)).type '(x(i),LowerParams(1:end-1))']); 121 | f1U=f1U*MemberUpper; 122 | f1L=f1L*MemberLower; 123 | else 124 | UpperParams = t2fis.input(i).mf(1,abs(rules(n,i))).params; 125 | LowerParams = t2fis.input(i).mf(2,abs(rules(n,i))).params; 126 | %MemberUpper = UpperParams(end)*eval(['helper.' t2fis.input(i).mf(1,abs(rules(n,i))).type '(x(i),UpperParams(1:end-1))']); 127 | %MemberLower = LowerParams(end)*eval(['helper.' t2fis.input(i).mf(2,abs(rules(n,i))).type '(x(i),LowerParams(1:end-1))']); 128 | MemberUpper = UpperParams(end)*helper.evalMfTypeHelper(t2fis.input(i).mf(1,abs(rules(n,i))).type,x(i),UpperParams(1:end-1)); 129 | MemberLower = LowerParams(end)*eval([ t2fis.input(i).mf(2,abs(rules(n,i))).type '(x(i),LowerParams(1:end-1))']); 130 | if MemberUpper==0 131 | MemberUpper=1; 132 | else 133 | MemberUpper=1/MemberUpper; 134 | end 135 | if MemberLower==0 136 | MemberLower=LowerParams(end); 137 | else 138 | MemberLower=LowerParams(end)/MemberLower; 139 | end 140 | f1U=f1U*MemberUpper; 141 | f1L=f1L*MemberLower; 142 | end 143 | end 144 | 145 | F(n,:) = [f1L,f1U]; 146 | 147 | outputType = t2fis.output.mf(t2fis.rule(n).consequent).type; 148 | if strcmpi(outputType,'constant') 149 | outMFPar = t2fis.output.mf(t2fis.rule(n).consequent).params; 150 | % C(n,:) = [x 1]*[outMFPar(1) outMFPar(1) outMFPar(1)]'; 151 | C(n,:) = outMFPar(1); 152 | C(n,2) = outMFPar(2); 153 | elseif strcmpi(outputType,'linear') 154 | outMFPar = t2fis.output.mf(t2fis.rule(n).consequent).params; 155 | outMFParUpper = outMFPar(1,1:nInput); 156 | C(n,:)=outMFParUpper*input'+outMFPar(1,nInput+1); 157 | 158 | outMFParLower = outMFPar(1,end/2+1:end-1); 159 | C(n,2)=outMFParLower*input'+outMFPar(1,end); 160 | 161 | end 162 | end 163 | 164 | %% Read KM method from t2fis file 165 | 166 | switch TRMethod 167 | case 'Karnik-Mendel' 168 | TRMethodfunc='t2f_TR_KM'; 169 | case 'KM' 170 | TRMethodfunc='t2f_TR_KM'; 171 | case 'EKM' 172 | TRMethodfunc='t2f_TR_EKM'; 173 | case 'IASC' 174 | TRMethodfunc='t2f_TR_IASC'; 175 | case 'EIASC' 176 | TRMethodfunc='t2f_TR_EIASC'; 177 | case 'EODS' 178 | TRMethodfunc='t2f_TR_EODS'; 179 | case 'WM' 180 | TRMethodfunc='t2f_TR_WM'; 181 | case 'NT' 182 | TRMethodfunc='t2f_TR_NT'; 183 | case 'BMM' 184 | TRMethodfunc='t2f_TR_BMM'; 185 | otherwise 186 | TRMethodfunc=TRMethod; 187 | end 188 | 189 | 190 | %% Calculate Output 191 | if strncmp(TRMethod,'BMM',3) 192 | alfa=str2num(TRMethod(5:regexp(TRMethod,',')-1)); 193 | beta=str2num(TRMethod(regexp(TRMethod,',')+1:end-1)); 194 | TRMethodfunc='t2f_TR_BMM'; 195 | [yL,yR,L,R] = feval(TRMethodfunc,F,C); 196 | else 197 | % TRMethodfunc='t2f_TR_EIASC'; 198 | [yL,yR,L,R] = feval(TRMethodfunc,F,C); 199 | end 200 | y(inputSeq,1)=(yL+yR)/2; 201 | end 202 | % elapsedTime=toc; -------------------------------------------------------------------------------- /Read_Eval_Functions/readt2fis.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [out,errorStr]=readt2fis(fileName,pathName) 14 | out=[]; 15 | if nargin<1 16 | [fileName,pathName]=uigetfile('*.t2fis','Read FIS'); 17 | if isequal(fileName,0) || isequal(pathName,0) 18 | % If fileName is zero, "cancel" was hit, or there was an error. 19 | errorStr='No file was loaded'; 20 | if nargout<2 21 | error(errorStr); 22 | end 23 | return 24 | end 25 | fileName = fullfile(pathName, fileName); 26 | else 27 | if ischar(fileName) 28 | [pathstr, name, ext] = fileparts(fileName); 29 | if nargin==2 30 | pathstr=pathName; 31 | end 32 | 33 | if ~strcmp(ext,'.t2fis') 34 | name = [name ext]; 35 | ext = '.t2fis'; 36 | end 37 | if isempty(name) 38 | errorStr = 'Empty file name: no file was loaded'; 39 | if nargout<2 40 | error(errorStr); 41 | end 42 | return 43 | end 44 | fileName = fullfile(pathstr,[name ext]); 45 | else 46 | error('File name must be specified as a string.') 47 | end 48 | end 49 | 50 | [fid,errorStr]=fopen(fileName,'r'); 51 | if fid<0 52 | if nargout<2 53 | error(errorStr); 54 | end 55 | return 56 | end 57 | 58 | nextLineVar=' '; 59 | topic='[System]'; 60 | while isempty(findstr(nextLineVar,topic)) 61 | nextLineVar=LocalNextline(fid); 62 | end 63 | 64 | Name='IT2-FLS'; 65 | Type='sugeno'; 66 | AndMethod='product'; 67 | OrMethod='sum'; 68 | ImpMethod='prod'; 69 | AggMethod='sum'; 70 | DefuzzMethod='wtaver'; 71 | TypeRedMethod='KM'; 72 | 73 | nextLineVar=' '; 74 | while isempty([findstr(nextLineVar,'[Input') findstr(nextLineVar,'[Output') 75 | findstr(nextLineVar,'[Rules')]) %#ok 76 | eval([nextLineVar ';']); 77 | nextLineVar=LocalNextline(fid); 78 | end 79 | 80 | out.name=Name; 81 | out.type=Type; 82 | out.andMethod=AndMethod; 83 | out.orMethod=OrMethod; 84 | out.defuzzMethod=DefuzzMethod; 85 | out.impMethod=ImpMethod; 86 | out.aggMethod=AggMethod; 87 | out.typeRedMethod=TypeRedMethod; 88 | 89 | frewind(fid) 90 | 91 | %Initialize parameters 92 | for varIndex=1:NumInputs 93 | nextLineVar=' '; 94 | topic='[Input'; 95 | while isempty(findstr(nextLineVar,topic)) 96 | nextLineVar=LocalNextline(fid); 97 | end 98 | 99 | Name=0; 100 | eval([LocalNextline(fid) ';']) 101 | out.input(varIndex).name=Name; 102 | % Input variable range 103 | Range=0; 104 | eval([LocalNextline(fid) ';']) 105 | out.input(varIndex).range=Range; 106 | 107 | % Number of membership functions 108 | eval([LocalNextline(fid) ';']); 109 | 110 | for MFIndex=1:NumMFs*2 111 | MFIndex2=round(MFIndex/2); 112 | if ~helper.isInt(MFIndex/2) 113 | MFIndex1=1; 114 | else 115 | MFIndex1=2; 116 | end 117 | MFStr=LocalNextline(fid); 118 | nameStart=findstr(MFStr,'='); 119 | nameEnd=findstr(MFStr,':'); 120 | MFName=eval(MFStr((nameStart+1):(nameEnd-1))); 121 | typeStart=findstr(MFStr,':'); 122 | typeEnd=findstr(MFStr,','); 123 | MFType=eval(MFStr((typeStart+1):(typeEnd-1))); 124 | MFParams=eval(MFStr((typeEnd+1):length(MFStr))); 125 | out.input(varIndex).mf(MFIndex1,MFIndex2).name=MFName; 126 | out.input(varIndex).mf(MFIndex1,MFIndex2).type=MFType; 127 | out.input(varIndex).mf(MFIndex1,MFIndex2).params=MFParams; 128 | end 129 | end 130 | 131 | for varIndex=1:NumOutputs 132 | nextLineVar=' '; 133 | topic='Output'; 134 | while isempty(findstr(nextLineVar,topic)) 135 | nextLineVar=LocalNextline(fid); 136 | end 137 | varName=LocalNextline(fid); 138 | varName=strrep(varName,'Name',''); 139 | varName=eval(strrep(varName,'=','')); 140 | out.output(varIndex).name=varName; 141 | rangeStr=LocalNextline(fid); 142 | if ~contains(rangeStr,'CrispInterval') 143 | rangeStr=strrep(rangeStr,'Range',''); 144 | rangeStr=strrep(rangeStr,'=',''); 145 | out.output(varIndex).range=eval(['[' rangeStr ']']); 146 | else 147 | crispStr=strrep(rangeStr,'CrispInterval',''); 148 | crispStr=strrep(crispStr,'=',''); 149 | out.output(varIndex).crisp=eval(['[' crispStr ']']); 150 | rangeStr=LocalNextline(fid); 151 | rangeStr=strrep(rangeStr,'Range',''); 152 | rangeStr=strrep(rangeStr,'=',''); 153 | out.output(varIndex).range=eval(['[' rangeStr ']']); 154 | end 155 | NumMFsStr=LocalNextline(fid); 156 | NumMFsStr=strrep(NumMFsStr,'NumMFs',''); 157 | NumMFsStr=strrep(NumMFsStr,'=',''); 158 | NumMFs=eval(NumMFsStr); 159 | 160 | for MFIndex=1:NumMFs 161 | MFStr=LocalNextline(fid); 162 | nameStart=findstr(MFStr,'='); 163 | nameEnd=findstr(MFStr,':'); 164 | MFName=eval(MFStr((nameStart+1):(nameEnd-1))); 165 | typeStart=findstr(MFStr,':'); 166 | typeEnd=findstr(MFStr,','); 167 | MFType=eval(MFStr((typeStart+1):(typeEnd-1))); 168 | MFParams=eval(MFStr((typeEnd+1):length(MFStr))); 169 | out.output(varIndex).mf(MFIndex).name=MFName; 170 | out.output(varIndex).mf(MFIndex).type=MFType; 171 | out.output(varIndex).mf(MFIndex).params=MFParams; 172 | end 173 | end 174 | nextLineVar=' '; 175 | topic='Rules'; 176 | while isempty(findstr(nextLineVar,topic)) 177 | nextLineVar=LocalNextline(fid); 178 | end 179 | 180 | ruleIndex=1; 181 | txtRuleList=[]; 182 | out.rule=[]; 183 | while ~feof(fid) 184 | ruleStr=LocalNextline(fid); 185 | if ischar(ruleStr) 186 | txtRuleList(ruleIndex,1:length(ruleStr))=ruleStr; 187 | ruleIndex=ruleIndex+1; 188 | end 189 | end 190 | out=helper.rulet2(out,txtRuleList); 191 | fclose(fid); 192 | 193 | 194 | 195 | function outLine=LocalNextline(fid) 196 | %LOCALNEXTLINE Return the next non-empty line of a file. 197 | % OUTLINE=LOCALNEXTLINE(FID) returns the next non-empty line in the 198 | % file whose file ID is FID. The file FID must already be open. 199 | % LOCALNEXTLINE skips all lines that consist only of a carriage 200 | % return and it returns a -1 when the end of the file has been 201 | % reached. 202 | % 203 | % LOCALNEXTLINE ignores all lines that begin with the % comment 204 | % character (the % character must be in the first column) 205 | 206 | % Ned Gulley, 2-2-94 207 | 208 | outLine=fgetl(fid); 209 | stopFlag=0; 210 | while (~stopFlag) 211 | if ~isempty(outLine) 212 | if (~strcmp(outLine(1),'%') || (outLine ==-1)) 213 | stopFlag=1; 214 | end 215 | else 216 | outLine=fgetl(fid); 217 | end 218 | end 219 | -------------------------------------------------------------------------------- /Read_Eval_Functions/t2f_TR_BMM.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [yLeft,yRight,L,R]=t2f_TR_BMM(F,Y,alfa,beta) 14 | %% IASC Algorithm for Computing Y Left 15 | if nargin==2 16 | alfa=0.5; 17 | beta=0.5; 18 | end 19 | % Sort Y matrix 20 | lowerY = Y(:,1); 21 | upperY = Y(:,2); 22 | [~, ind] = sort(lowerY); 23 | lowerY = lowerY(ind,:); 24 | upperY = upperY(ind,:); 25 | sortedF = F(ind,:); 26 | lowerF = sortedF(:,1); 27 | upperF = sortedF(:,2); 28 | 29 | % Convert to crisp Y matrix 30 | 31 | if isequal(lowerY,upperY) 32 | y=lowerY; 33 | else 34 | y=(lowerY+upperY)/2; 35 | end 36 | 37 | yLeft=alfa*(sum(y.*(lowerF)))/sum(lowerF)+beta*(sum(y.*(upperF)))/sum(upperF); 38 | yRight=yLeft; 39 | L='no'; 40 | R='no'; -------------------------------------------------------------------------------- /Read_Eval_Functions/t2f_TR_EIASC.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [yLeft,yRight,L,R]=t2f_TR_EIASC(F,Y) 14 | %% EIASC Algorithm for Computing Y Left 15 | 16 | % Sort Y matrix 17 | lowerY = Y(:,1); 18 | [~, ind] = sort(lowerY); 19 | lowerY = lowerY(ind,:); 20 | sortedF = F(ind,:); 21 | lowerF = sortedF(:,1); 22 | upperF = sortedF(:,2); 23 | 24 | % Step 1. 25 | N=size(F,1); 26 | a= sum(lowerY.*lowerF); 27 | b= sum(lowerF); 28 | L=0; 29 | 30 | 31 | while(1) 32 | % Step 2. 33 | L=L+1; 34 | a=a+lowerY(L)*(upperF(L)-lowerF(L)); 35 | b=b+upperF(L)-lowerF(L); 36 | yl=a/b; 37 | 38 | % Step 3. 39 | if yl<=lowerY(L+1) 40 | L=L; 41 | yLeft=yl; 42 | break 43 | 44 | end 45 | 46 | end 47 | 48 | %% EIASC Algorithm for Computing Y right 49 | 50 | % Sort Y matrix 51 | upperY = Y(:,2); 52 | [~, ind] = sort(upperY); 53 | upperY = upperY(ind,:); 54 | sortedF = F(ind,:); 55 | lowerF = sortedF(:,1); 56 | upperF = sortedF(:,2); 57 | 58 | % Step 1. 59 | 60 | a = sum(upperY.*lowerF); 61 | b = sum(lowerF); 62 | R = N; 63 | 64 | while(1) 65 | % Step 2. 66 | a=a+upperY(R)*(upperF(R)-lowerF(R)); 67 | b=b+upperF(R)-lowerF(R); 68 | yr=a/b; 69 | R=R-1; 70 | % Step 3. 71 | if yr>=upperY(R) 72 | R=R; 73 | yRight=yr; 74 | break 75 | end 76 | 77 | end -------------------------------------------------------------------------------- /Read_Eval_Functions/t2f_TR_EKM.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [yLeft,yRight,L,R]=t2f_TR_EKM(F,Y) 14 | %% EKM Algorithm for Computing Y Left 15 | 16 | % a) Sort Y matrix 17 | lowerY = Y(:,1); 18 | [~, ind] = sort(lowerY); 19 | lowerY = lowerY(ind,:); 20 | sortedF = F(ind,:); 21 | lowerF = sortedF(:,1); 22 | upperF = sortedF(:,2); 23 | 24 | % Step 1. 25 | N=size(F,1); 26 | l=round(N/2.4); 27 | a= sum(lowerY(1:l).*upperF(1:l)) + sum(lowerY(l+1:end).*lowerF(l+1:end)); 28 | b= sum(upperF(1:l)) + sum(lowerF(l+1:end)); 29 | y=a/b; 30 | 31 | while(1) 32 | 33 | % Step 2. 34 | lussu = 0; 35 | for i=1:N-1; 36 | if y>=lowerY(i) && y<=lowerY(i+1) 37 | lussu = i; 38 | break 39 | end 40 | end 41 | 42 | % Step 3. 43 | if lussu==l 44 | yLeft = y; 45 | L = l; 46 | break 47 | else 48 | 49 | % Step 4. 50 | s=sign(lussu-l); 51 | aussu=a+s*(sum(lowerY(min(l,lussu)+1:max(l,lussu)).*(upperF(min(l,lussu)+1:max(l,lussu))-lowerF(min(l,lussu)+1:max(l,lussu))))); 52 | bussu=b+s*(sum(upperF(min(l,lussu)+1:max(l,lussu))-lowerF(min(l,lussu)+1:max(l,lussu)))); 53 | yussu=aussu/bussu; 54 | % Step 5. 55 | y=yussu; 56 | a=aussu; 57 | b=bussu; 58 | l=lussu; 59 | end 60 | end 61 | 62 | %% EKM Algorithm for Computing Y right 63 | 64 | % Sort Y matrix 65 | upperY = Y(:,2); 66 | [~, ind] = sort(upperY); 67 | upperY = upperY(ind,:); 68 | sortedF = F(ind,:); 69 | lowerF = sortedF(:,1); 70 | upperF = sortedF(:,2); 71 | 72 | % Step 1. 73 | r=round(N/1.7); 74 | a= sum(upperY(1:r).*lowerF(1:r)) + sum(upperY(r+1:end).*upperF(r+1:end)); 75 | b= sum(lowerF(1:r)) + sum(upperF(r+1:end)); 76 | y=a/b; 77 | 78 | while(1) 79 | 80 | % Step 2. 81 | russu = 0; 82 | for i=1:N-1; 83 | if y>=upperY(i) && y<=upperY(i+1) 84 | russu = i; 85 | break 86 | end 87 | end 88 | 89 | % Step 3. 90 | if russu==r 91 | yRight = y; 92 | R = r; 93 | break 94 | else 95 | 96 | % Step 4. 97 | s=sign(russu-r); 98 | aussu=a-s*(sum(upperY(min(r,russu)+1:max(r,russu)).*(upperF(min(r,russu)+1:max(r,russu))-lowerF(min(r,russu)+1:max(r,russu))))); 99 | bussu=b-s*(sum(upperF(min(r,russu)+1:max(r,russu))-lowerF(min(r,russu)+1:max(r,russu)))); 100 | yussu=aussu/bussu; 101 | % Step 5. 102 | y=yussu; 103 | a=aussu; 104 | b=bussu; 105 | r=russu; 106 | end 107 | end -------------------------------------------------------------------------------- /Read_Eval_Functions/t2f_TR_EODS.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [yLeft,yRight,L,R]=t2f_TR_EODS(F,Y) 14 | %% EODS Algorithm for Computing Y Left 15 | 16 | % Sort Y matrix 17 | lowerY = Y(:,1); 18 | [~, ind] = sort(lowerY); 19 | lowerY = lowerY(ind,:); 20 | sortedF = F(ind,:); 21 | lowerF = sortedF(:,1); 22 | upperF = sortedF(:,2); 23 | 24 | % Step 1. 25 | N=size(F,1); 26 | m=2; 27 | n=N-1; 28 | Sl=(lowerY(m)-lowerY(1))*upperF(1); 29 | Sr=(lowerY(N)-lowerY(n))*lowerF(N); 30 | Fl=lowerF(N); 31 | Fr=upperF(1); 32 | 33 | 34 | while(1) 35 | % Step 2. 36 | if m==n 37 | %Step 4. 38 | if Sl<=Sr 39 | L=m; 40 | Fr=Fr+upperF(m); 41 | else 42 | L=m-1; 43 | Fl=Fl+lowerF(m); 44 | end 45 | % Step 5. 46 | yl=lowerY(m)+((Sr-Sl)/(Fr+Fl)); 47 | yLeft=yl; 48 | break 49 | else 50 | % Step 3. 51 | if Sl>Sr 52 | Fl=Fl+lowerF(n); 53 | n=n-1; 54 | Sr=Sr+Fl*(lowerY(n+1)-lowerY(n)); 55 | else 56 | Fr=Fr+upperF(m); 57 | m=m+1; 58 | Sl=Sl+Fr*(lowerY(m)-lowerY(m-1)); 59 | end 60 | end 61 | end 62 | 63 | %% EODS Algorithm for Computing Y right 64 | 65 | % Sort Y matrix 66 | upperY = Y(:,2); 67 | [~, ind] = sort(lowerY); 68 | upperY = upperY(ind,:); 69 | sortedF = F(ind,:); 70 | lowerF = sortedF(:,1); 71 | upperF = sortedF(:,2); 72 | 73 | % Step 1. 74 | N=size(F,1); 75 | m=2; 76 | n=N-1; 77 | Sl=(upperY(m)-upperY(1))*lowerF(1); 78 | Sr=(upperY(N)-upperY(n))*upperF(N); 79 | Fl=lowerF(1); 80 | Fr=upperF(N); 81 | 82 | 83 | while(1) 84 | % Step 2. 85 | if m==n 86 | %Step 4. 87 | if Sl<=Sr 88 | R=m; 89 | Fl=Fl+lowerF(m); 90 | else 91 | R=m-1; 92 | Fr=Fr+upperF(m); 93 | end 94 | % Step 5. 95 | yr=upperY(m)+((Sr-Sl)/(Fr+Fl)); 96 | yRight=yr; 97 | break 98 | else 99 | % Step 3. 100 | if Sl>Sr 101 | Fr=Fr+upperF(n); 102 | n=n-1; 103 | Sr=Sr+Fr*(upperY(n+1)-upperY(n)); 104 | else 105 | Fl=Fl+lowerF(m); 106 | m=m+1; 107 | Sl=Sl+Fl*(upperY(m)-upperY(m-1)); 108 | end 109 | end 110 | end -------------------------------------------------------------------------------- /Read_Eval_Functions/t2f_TR_IASC.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [yLeft,yRight,L,R]=t2f_TR_IASC(F,Y) 14 | %% IASC Algorithm for Computing Y Left 15 | 16 | % Sort Y matrix 17 | lowerY = Y(:,1); 18 | [~, ind] = sort(lowerY); 19 | lowerY = lowerY(ind,:); 20 | sortedF = F(ind,:); 21 | lowerF = sortedF(:,1); 22 | upperF = sortedF(:,2); 23 | 24 | % Step 1. 25 | N=size(F,1); 26 | a= sum(lowerY.*lowerF); 27 | b= sum(lowerF); 28 | yl=lowerY(N); 29 | l=0; 30 | 31 | 32 | while(1) 33 | % Step 2. 34 | l=l+1; 35 | a=a+lowerY(l)*(upperF(l)-lowerF(l)); 36 | b=b+upperF(l)-lowerF(l); 37 | c=a/b; 38 | 39 | % Step 3. 40 | if c>=yl 41 | L=l-1; 42 | yLeft=yl; 43 | break 44 | else 45 | yl=c; 46 | end 47 | 48 | end 49 | 50 | %% IASC Algorithm for Computing Y right 51 | 52 | % Sort Y matrix 53 | upperY = Y(:,2); 54 | [~, ind] = sort(upperY); 55 | upperY = upperY(ind,:); 56 | sortedF = F(ind,:); 57 | lowerF = sortedF(:,1); 58 | upperF = sortedF(:,2); 59 | 60 | % Step 1. 61 | 62 | a= sum(upperY.*upperF); 63 | b= sum(upperF); 64 | yr=upperY(1); 65 | r=0; 66 | 67 | 68 | while(1) 69 | % Step 2. 70 | r=r+1; 71 | a=a-upperY(r)*(upperF(r)-lowerF(r)); 72 | b=b-upperF(r)+lowerF(r); 73 | c=a/b; 74 | 75 | % Step 3. 76 | if c<=yr 77 | R=r-1; 78 | yRight=yr; 79 | break 80 | else 81 | yr=c; 82 | end 83 | 84 | end -------------------------------------------------------------------------------- /Read_Eval_Functions/t2f_TR_KM.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [yLeft,yRight,L,R]=t2f_TR_KM(F,Y) 14 | %% KM Algorithm for Computing Y Left 15 | 16 | % a) Sort Y matrix 17 | lowerY = Y(:,1); 18 | [~, ind] = sort(lowerY); 19 | lowerY = lowerY(ind,:); 20 | sortedF = F(ind,:); 21 | % b) Initialize fn by setting and computing 22 | FOrt = sum(F')'/2; 23 | isZero=(sum(FOrt)==0); 24 | nRules=size(F,1); 25 | if isZero 26 | yn=0; 27 | else 28 | yn = sum(lowerY.*FOrt)/sum(FOrt); 29 | end 30 | while(1) 31 | % c) Find switch point k (1 <= k <= N ? 1) such that yk <= y <= yk+1 32 | sPointLeft = 0; 33 | for i=1:nRules-1; 34 | if yn>=lowerY(i) && yn<=lowerY(i+1) 35 | sPointLeft = i; 36 | break 37 | end 38 | end 39 | % d) Compute 40 | for i=1:nRules 41 | if i<=sPointLeft 42 | fn(i,1) = sortedF(i,2); 43 | elseif i>sPointLeft 44 | fn(i,1) = sortedF(i,1); 45 | end 46 | 47 | end 48 | if(sum(fn)==0) 49 | ynPrime=0; 50 | else 51 | ynPrime = sum(lowerY.*fn)/sum(fn); 52 | end 53 | % e) if yn==ynPrime stop else go to c) 54 | if(abs(yn-ynPrime)<10^-3) 55 | yLeft = yn; 56 | L = sPointLeft; 57 | break; 58 | else 59 | yn=ynPrime; 60 | end 61 | end 62 | 63 | %% KM Algorithm for Computing Y Right 64 | % a) Sort Y matrix 65 | UpperY = Y(:,2); 66 | [~, ind ] = sort(UpperY); 67 | UpperY=UpperY(ind,:); 68 | sortedF = F(ind,:); 69 | 70 | % b) Initialize fn by setting and computing 71 | FOrt = sum(F')'/2; 72 | isZero=(sum(FOrt)==0); 73 | nRules=size(F,1); 74 | if isZero 75 | yn=0; 76 | else 77 | yn = sum(UpperY.*FOrt)/sum(FOrt); 78 | end 79 | % c) Find switch point k (1 <= k <= N ? 1) such that yk <= y <= yk+1 80 | while(1) 81 | sPointRight = 0; 82 | for i=1:nRules-1; 83 | if yn>=UpperY(i) && yn<=UpperY(i+1) 84 | sPointRight = i; 85 | break 86 | end 87 | end 88 | for i=1:nRules 89 | if i<=sPointRight 90 | fn(i,1) = sortedF(i,1); 91 | elseif i>sPointRight 92 | fn(i,1) = sortedF(i,2); 93 | end 94 | end 95 | if(sum(fn)==0) 96 | ynPrime=0; 97 | else 98 | ynPrime = sum(UpperY.*fn)/sum(fn); 99 | end 100 | % e) if yn==ynPrime stop else go to c) 101 | if(abs(yn-ynPrime)<10^-3) 102 | yRight = yn; 103 | R = sPointRight; 104 | break; 105 | else 106 | yn=ynPrime; 107 | end 108 | end -------------------------------------------------------------------------------- /Read_Eval_Functions/t2f_TR_NT.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [yLeft,yRight,L,R]=t2f_TR_NT(F,Y) 14 | % Sort Y matrix 15 | lowerY = Y(:,1); 16 | upperY = Y(:,2); 17 | [~, ind] = sort(lowerY); 18 | lowerY = lowerY(ind,:); 19 | upperY = upperY(ind,:); 20 | sortedF = F(ind,:); 21 | lowerF = sortedF(:,1); 22 | upperF = sortedF(:,2); 23 | 24 | % Convert to crisp Y matrix 25 | 26 | if isequal(lowerY,upperY) 27 | y=lowerY; 28 | else 29 | y=(lowerY+upperY)/2; 30 | end 31 | 32 | 33 | % y=()/(); 34 | 35 | yLeft=(sum(y.*(upperF+lowerF)))/sum(upperF+lowerF); 36 | yRight=yLeft; 37 | L='no'; 38 | R='no'; -------------------------------------------------------------------------------- /Read_Eval_Functions/t2f_TR_WM.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function [yLeft,yRight,L,R]=t2f_TR_WM(F,Y) 14 | % Sort Y matrix 15 | lowerY = Y(:,1); 16 | upperY = Y(:,2); 17 | [~, ind] = sort(lowerY); 18 | lowerY = lowerY(ind,:); 19 | upperY = upperY(ind,:); 20 | sortedF = F(ind,:); 21 | lowerF = sortedF(:,1); 22 | upperF = sortedF(:,2); 23 | 24 | upperyl=min(sum(lowerY.*(lowerF))/sum(lowerF),sum(lowerY.*(upperF))/sum(upperF)); 25 | 26 | loweryr=min(sum(upperY.*(lowerF))/sum(lowerF),sum(upperY.*(upperF))/sum(upperF)); 27 | 28 | loweryl=upperyl-(sum(upperF-lowerF)/(sum(upperF)*sum(lowerF)) * sum(lowerF.*(lowerY-lowerY(1))) * sum(upperF.*(lowerY(end)-lowerY)) / (sum(lowerF.*(lowerY-lowerY(1)))+sum(upperF.*(lowerY(end)-lowerY)))); 29 | 30 | upperyr=loweryr+(sum(upperF-lowerF)/(sum(upperF)*sum(lowerF))*sum(upperF.*(upperY-upperY(1)))*sum(lowerF.*(upperY(end)-upperY))/(sum(upperF.*(upperY-upperY(1)))+sum(lowerF.*(upperY(end)-upperY)))); 31 | if isnan(loweryl) 32 | loweryl=upperyl; 33 | end 34 | if isnan(upperyr) 35 | upperyr=loweryr; 36 | end 37 | 38 | 39 | yLeft=(loweryl+upperyl)/2; 40 | yRight=(loweryr+upperyr)/2; 41 | L=0; 42 | R=0; -------------------------------------------------------------------------------- /Simulink_Lib/Fuzzy_Type2_Lib.mdl.r2012b: -------------------------------------------------------------------------------- 1 | Library { 2 | Name "Fuzzy_Type2_Lib" 3 | Version 8.0 4 | MdlSubVersion 0 5 | SavedCharacterEncoding "windows-1254" 6 | LibraryType "BlockLibrary" 7 | SaveDefaultBlockParams on 8 | ScopeRefreshTime 0.035000 9 | OverrideScopeRefreshTime on 10 | DisableAllScopes off 11 | FPTRunName "Run 1" 12 | MaxMDLFileLineLength 120 13 | Object { 14 | $PropName "BdWindowsInfo" 15 | $ObjectID 1 16 | $ClassName "Simulink.BDWindowsInfo" 17 | Object { 18 | $PropName "WindowsInfo" 19 | $ObjectID 2 20 | $ClassName "Simulink.WindowInfo" 21 | IsActive [1] 22 | Location [229.0, 96.0, 1114.0, 652.0] 23 | Object { 24 | $PropName "ModelBrowserInfo" 25 | $ObjectID 3 26 | $ClassName "Simulink.ModelBrowserInfo" 27 | Visible [1] 28 | DockPosition "Left" 29 | Width [50] 30 | Height [50] 31 | Filter [9] 32 | } 33 | Object { 34 | $PropName "ExplorerBarInfo" 35 | $ObjectID 4 36 | $ClassName "Simulink.ExplorerBarInfo" 37 | Visible [1] 38 | } 39 | Array { 40 | Type "Simulink.EditorInfo" 41 | Dimension 2 42 | Object { 43 | $ObjectID 5 44 | IsActive [1] 45 | ViewObjType "SimulinkSubsys" 46 | LoadSaveID "9" 47 | Extents [867.0, 481.0] 48 | ZoomFactor [1.0] 49 | Offset [0.0, 0.0] 50 | } 51 | Object { 52 | $ObjectID 6 53 | IsActive [0] 54 | ViewObjType "SimulinkSubsys" 55 | LoadSaveID "1" 56 | Extents [867.0, 481.0] 57 | ZoomFactor [1.0] 58 | Offset [0.0, 0.0] 59 | } 60 | PropName "EditorsInfo" 61 | } 62 | } 63 | } 64 | Created "Tue Dec 16 20:34:43 2014" 65 | Creator "u11f99" 66 | UpdateHistory "UpdateHistoryNever" 67 | ModifiedByFormat "%" 68 | LastModifiedBy "Home" 69 | ModifiedDateFormat "%" 70 | LastModifiedDate "Sun Mar 27 19:51:42 2016" 71 | RTWModifiedTimeStamp 381009100 72 | ModelVersionFormat "1.%" 73 | ConfigurationManager "None" 74 | SampleTimeColors off 75 | SampleTimeAnnotations off 76 | LibraryLinkDisplay "disabled" 77 | WideLines off 78 | ShowLineDimensions off 79 | ShowPortDataTypes off 80 | ShowDesignRanges off 81 | ShowLoopsOnError on 82 | IgnoreBidirectionalLines off 83 | ShowStorageClass off 84 | ShowTestPointIcons on 85 | ShowSignalResolutionIcons on 86 | ShowViewerIcons on 87 | SortedOrder off 88 | ExecutionContextIcon off 89 | ShowLinearizationAnnotations on 90 | BlockNameDataTip off 91 | BlockParametersDataTip off 92 | BlockDescriptionStringDataTip off 93 | ToolBar on 94 | StatusBar on 95 | BrowserShowLibraryLinks off 96 | BrowserLookUnderMasks off 97 | SimulationMode "normal" 98 | LinearizationMsg "none" 99 | Profile off 100 | ParamWorkspaceSource "MATLABWorkspace" 101 | RecordCoverage off 102 | CovSaveName "covdata" 103 | CovMetricSettings "dw" 104 | CovNameIncrementing off 105 | CovHtmlReporting on 106 | CovForceBlockReductionOff on 107 | covSaveCumulativeToWorkspaceVar on 108 | CovSaveSingleToWorkspaceVar on 109 | CovCumulativeReport off 110 | CovReportOnPause on 111 | CovModelRefEnable "Off" 112 | CovExternalEMLEnable off 113 | ExtModeBatchMode off 114 | ExtModeEnableFloating on 115 | ExtModeTrigType "manual" 116 | ExtModeTrigMode "normal" 117 | ExtModeTrigPort "1" 118 | ExtModeTrigElement "any" 119 | ExtModeTrigDuration 1000 120 | ExtModeTrigDurationFloating "auto" 121 | ExtModeTrigHoldOff 0 122 | ExtModeTrigDelay 0 123 | ExtModeTrigDirection "rising" 124 | ExtModeTrigLevel 0 125 | ExtModeArchiveMode "off" 126 | ExtModeAutoIncOneShot off 127 | ExtModeIncDirWhenArm off 128 | ExtModeAddSuffixToVar off 129 | ExtModeWriteAllDataToWs off 130 | ExtModeArmWhenConnect on 131 | ExtModeSkipDownloadWhenConnect off 132 | ExtModeLogAll on 133 | ExtModeAutoUpdateStatusClock on 134 | ShowModelReferenceBlockVersion off 135 | ShowModelReferenceBlockIO off 136 | Array { 137 | Type "Handle" 138 | Dimension 1 139 | Simulink.ConfigSet { 140 | $ObjectID 7 141 | Version "1.12.1" 142 | Array { 143 | Type "Handle" 144 | Dimension 9 145 | Simulink.SolverCC { 146 | $ObjectID 8 147 | Version "1.12.1" 148 | StartTime "0.0" 149 | StopTime "10.0" 150 | AbsTol "auto" 151 | FixedStep "auto" 152 | InitialStep "auto" 153 | MaxNumMinSteps "-1" 154 | MaxOrder 5 155 | ZcThreshold "auto" 156 | ConsecutiveZCsStepRelTol "10*128*eps" 157 | MaxConsecutiveZCs "1000" 158 | ExtrapolationOrder 4 159 | NumberNewtonIterations 1 160 | MaxStep "auto" 161 | MinStep "auto" 162 | MaxConsecutiveMinStep "1" 163 | RelTol "1e-3" 164 | SolverMode "Auto" 165 | EnableConcurrentExecution off 166 | ConcurrentTasks off 167 | Solver "ode45" 168 | SolverName "ode45" 169 | SolverJacobianMethodControl "auto" 170 | ShapePreserveControl "DisableAll" 171 | ZeroCrossControl "UseLocalSettings" 172 | ZeroCrossAlgorithm "Nonadaptive" 173 | AlgebraicLoopSolver "TrustRegion" 174 | SolverResetMethod "Fast" 175 | PositivePriorityOrder off 176 | AutoInsertRateTranBlk off 177 | SampleTimeConstraint "Unconstrained" 178 | InsertRTBMode "Whenever possible" 179 | } 180 | Simulink.DataIOCC { 181 | $ObjectID 9 182 | Version "1.12.1" 183 | Decimation "1" 184 | ExternalInput "[t, u]" 185 | FinalStateName "xFinal" 186 | InitialState "xInitial" 187 | LimitDataPoints on 188 | MaxDataPoints "1000" 189 | LoadExternalInput off 190 | LoadInitialState off 191 | SaveFinalState off 192 | SaveCompleteFinalSimState off 193 | SaveFormat "Array" 194 | SignalLoggingSaveFormat "Dataset" 195 | SaveOutput on 196 | SaveState off 197 | SignalLogging on 198 | DSMLogging on 199 | InspectSignalLogs off 200 | SaveTime on 201 | ReturnWorkspaceOutputs off 202 | StateSaveName "xout" 203 | TimeSaveName "tout" 204 | OutputSaveName "yout" 205 | SignalLoggingName "logsout" 206 | DSMLoggingName "dsmout" 207 | OutputOption "RefineOutputTimes" 208 | OutputTimes "[]" 209 | ReturnWorkspaceOutputsName "out" 210 | Refine "1" 211 | } 212 | Simulink.OptimizationCC { 213 | $ObjectID 10 214 | Version "1.12.1" 215 | Array { 216 | Type "Cell" 217 | Dimension 8 218 | Cell "BooleansAsBitfields" 219 | Cell "PassReuseOutputArgsAs" 220 | Cell "PassReuseOutputArgsThreshold" 221 | Cell "ZeroExternalMemoryAtStartup" 222 | Cell "ZeroInternalMemoryAtStartup" 223 | Cell "OptimizeModelRefInitCode" 224 | Cell "NoFixptDivByZeroProtection" 225 | Cell "UseSpecifiedMinMax" 226 | PropName "DisabledProps" 227 | } 228 | BlockReduction on 229 | BooleanDataType on 230 | ConditionallyExecuteInputs on 231 | InlineParams off 232 | UseIntDivNetSlope off 233 | UseFloatMulNetSlope off 234 | UseSpecifiedMinMax off 235 | InlineInvariantSignals off 236 | OptimizeBlockIOStorage on 237 | BufferReuse on 238 | EnhancedBackFolding off 239 | StrengthReduction off 240 | ExpressionFolding on 241 | BooleansAsBitfields off 242 | BitfieldContainerType "uint_T" 243 | EnableMemcpy on 244 | MemcpyThreshold 64 245 | PassReuseOutputArgsAs "Structure reference" 246 | ExpressionDepthLimit 2147483647 247 | FoldNonRolledExpr on 248 | LocalBlockOutputs on 249 | RollThreshold 5 250 | SystemCodeInlineAuto off 251 | StateBitsets off 252 | DataBitsets off 253 | UseTempVars off 254 | ZeroExternalMemoryAtStartup on 255 | ZeroInternalMemoryAtStartup on 256 | InitFltsAndDblsToZero off 257 | NoFixptDivByZeroProtection off 258 | EfficientFloat2IntCast off 259 | EfficientMapNaN2IntZero on 260 | OptimizeModelRefInitCode off 261 | LifeSpan "inf" 262 | MaxStackSize "Inherit from target" 263 | BufferReusableBoundary on 264 | SimCompilerOptimization "Off" 265 | AccelVerboseBuild off 266 | ParallelExecutionInRapidAccelerator on 267 | } 268 | Simulink.DebuggingCC { 269 | $ObjectID 11 270 | Version "1.12.1" 271 | RTPrefix "error" 272 | ConsistencyChecking "none" 273 | ArrayBoundsChecking "none" 274 | SignalInfNanChecking "none" 275 | SignalRangeChecking "none" 276 | ReadBeforeWriteMsg "UseLocalSettings" 277 | WriteAfterWriteMsg "UseLocalSettings" 278 | WriteAfterReadMsg "UseLocalSettings" 279 | AlgebraicLoopMsg "warning" 280 | ArtificialAlgebraicLoopMsg "warning" 281 | SaveWithDisabledLinksMsg "warning" 282 | SaveWithParameterizedLinksMsg "warning" 283 | CheckSSInitialOutputMsg on 284 | UnderspecifiedInitializationDetection "Classic" 285 | MergeDetectMultiDrivingBlocksExec "none" 286 | CheckExecutionContextPreStartOutputMsg off 287 | CheckExecutionContextRuntimeOutputMsg off 288 | SignalResolutionControl "UseLocalSettings" 289 | BlockPriorityViolationMsg "warning" 290 | MinStepSizeMsg "warning" 291 | TimeAdjustmentMsg "none" 292 | MaxConsecutiveZCsMsg "error" 293 | MaskedZcDiagnostic "warning" 294 | IgnoredZcDiagnostic "warning" 295 | SolverPrmCheckMsg "warning" 296 | InheritedTsInSrcMsg "warning" 297 | DiscreteInheritContinuousMsg "warning" 298 | MultiTaskDSMMsg "error" 299 | MultiTaskCondExecSysMsg "error" 300 | MultiTaskRateTransMsg "error" 301 | SingleTaskRateTransMsg "none" 302 | TasksWithSamePriorityMsg "warning" 303 | SigSpecEnsureSampleTimeMsg "warning" 304 | CheckMatrixSingularityMsg "none" 305 | IntegerOverflowMsg "warning" 306 | Int32ToFloatConvMsg "warning" 307 | ParameterDowncastMsg "error" 308 | ParameterOverflowMsg "error" 309 | ParameterUnderflowMsg "none" 310 | ParameterPrecisionLossMsg "warning" 311 | ParameterTunabilityLossMsg "warning" 312 | FixptConstUnderflowMsg "none" 313 | FixptConstOverflowMsg "none" 314 | FixptConstPrecisionLossMsg "none" 315 | UnderSpecifiedDataTypeMsg "none" 316 | UnnecessaryDatatypeConvMsg "none" 317 | VectorMatrixConversionMsg "none" 318 | InvalidFcnCallConnMsg "error" 319 | FcnCallInpInsideContextMsg "EnableAllAsError" 320 | SignalLabelMismatchMsg "none" 321 | UnconnectedInputMsg "warning" 322 | UnconnectedOutputMsg "warning" 323 | UnconnectedLineMsg "warning" 324 | SFcnCompatibilityMsg "none" 325 | FrameProcessingCompatibilityMsg "warning" 326 | UniqueDataStoreMsg "none" 327 | BusObjectLabelMismatch "warning" 328 | RootOutportRequireBusObject "warning" 329 | AssertControl "UseLocalSettings" 330 | EnableOverflowDetection off 331 | ModelReferenceIOMsg "none" 332 | ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error" 333 | ModelReferenceVersionMismatchMessage "none" 334 | ModelReferenceIOMismatchMessage "none" 335 | ModelReferenceCSMismatchMessage "none" 336 | UnknownTsInhSupMsg "warning" 337 | ModelReferenceDataLoggingMessage "warning" 338 | ModelReferenceSymbolNameMessage "warning" 339 | ModelReferenceExtraNoncontSigs "error" 340 | StateNameClashWarn "warning" 341 | SimStateInterfaceChecksumMismatchMsg "warning" 342 | SimStateOlderReleaseMsg "error" 343 | InitInArrayFormatMsg "warning" 344 | StrictBusMsg "ErrorLevel1" 345 | BusNameAdapt "WarnAndRepair" 346 | NonBusSignalsTreatedAsBus "none" 347 | LoggingUnavailableSignals "error" 348 | BlockIODiagnostic "none" 349 | SFUnusedDataAndEventsDiag "warning" 350 | SFUnexpectedBacktrackingDiag "warning" 351 | SFInvalidInputDataAccessInChartInitDiag "warning" 352 | SFNoUnconditionalDefaultTransitionDiag "warning" 353 | SFTransitionOutsideNaturalParentDiag "warning" 354 | SFUnconditionalTransitionShadowingDiag "warning" 355 | SFUndirectedBroadcastEventsDiag "warning" 356 | SFTransitionActionBeforeConditionDiag "warning" 357 | } 358 | Simulink.HardwareCC { 359 | $ObjectID 12 360 | Version "1.12.1" 361 | ProdBitPerChar 8 362 | ProdBitPerShort 16 363 | ProdBitPerInt 32 364 | ProdBitPerLong 32 365 | ProdBitPerFloat 32 366 | ProdBitPerDouble 64 367 | ProdBitPerPointer 32 368 | ProdLargestAtomicInteger "Char" 369 | ProdLargestAtomicFloat "None" 370 | ProdIntDivRoundTo "Undefined" 371 | ProdEndianess "Unspecified" 372 | ProdWordSize 32 373 | ProdShiftRightIntArith on 374 | ProdHWDeviceType "32-bit Generic" 375 | TargetBitPerChar 8 376 | TargetBitPerShort 16 377 | TargetBitPerInt 32 378 | TargetBitPerLong 32 379 | TargetBitPerFloat 32 380 | TargetBitPerDouble 64 381 | TargetBitPerPointer 32 382 | TargetLargestAtomicInteger "Char" 383 | TargetLargestAtomicFloat "None" 384 | TargetShiftRightIntArith on 385 | TargetIntDivRoundTo "Undefined" 386 | TargetEndianess "Unspecified" 387 | TargetWordSize 32 388 | TargetTypeEmulationWarnSuppressLevel 0 389 | TargetPreprocMaxBitsSint 32 390 | TargetPreprocMaxBitsUint 32 391 | TargetHWDeviceType "Specified" 392 | TargetUnknown off 393 | ProdEqTarget on 394 | } 395 | Simulink.ModelReferenceCC { 396 | $ObjectID 13 397 | Version "1.12.1" 398 | UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" 399 | CheckModelReferenceTargetMessage "error" 400 | EnableParallelModelReferenceBuilds off 401 | ParallelModelReferenceErrorOnInvalidPool on 402 | ParallelModelReferenceMATLABWorkerInit "None" 403 | ModelReferenceNumInstancesAllowed "Multi" 404 | PropagateVarSize "Infer from blocks in model" 405 | ModelReferencePassRootInputsByReference on 406 | ModelReferenceMinAlgLoopOccurrences off 407 | PropagateSignalLabelsOutOfModel off 408 | SupportModelReferenceSimTargetCustomCode off 409 | } 410 | Simulink.SFSimCC { 411 | $ObjectID 14 412 | Version "1.12.1" 413 | SFSimEnableDebug on 414 | SFSimOverflowDetection on 415 | SFSimEcho on 416 | SimBlas on 417 | SimCtrlC on 418 | SimExtrinsic on 419 | SimIntegrity on 420 | SimUseLocalCustomCode off 421 | SimParseCustomCode on 422 | SimBuildMode "sf_incremental_build" 423 | } 424 | Simulink.RTWCC { 425 | $BackupClass "Simulink.RTWCC" 426 | $ObjectID 15 427 | Version "1.12.1" 428 | Array { 429 | Type "Cell" 430 | Dimension 15 431 | Cell "IncludeHyperlinkInReport" 432 | Cell "GenerateTraceInfo" 433 | Cell "GenerateTraceReport" 434 | Cell "GenerateTraceReportSl" 435 | Cell "GenerateTraceReportSf" 436 | Cell "GenerateTraceReportEml" 437 | Cell "PortableWordSizes" 438 | Cell "GenerateWebview" 439 | Cell "GenerateCodeMetricsReport" 440 | Cell "GenerateCodeReplacementReport" 441 | Cell "GenerateErtSFunction" 442 | Cell "CreateSILPILBlock" 443 | Cell "CodeExecutionProfiling" 444 | Cell "CodeProfilingSaveOptions" 445 | Cell "CodeProfilingInstrumentation" 446 | PropName "DisabledProps" 447 | } 448 | SystemTargetFile "grt.tlc" 449 | GenCodeOnly off 450 | MakeCommand "make_rtw" 451 | GenerateMakefile on 452 | PackageGeneratedCodeAndArtifacts off 453 | TemplateMakefile "grt_default_tmf" 454 | GenerateReport off 455 | SaveLog off 456 | RTWVerbose on 457 | RetainRTWFile off 458 | ProfileTLC off 459 | TLCDebug off 460 | TLCCoverage off 461 | TLCAssert off 462 | ProcessScriptMode "Default" 463 | ConfigurationMode "Optimized" 464 | ConfigAtBuild off 465 | RTWUseLocalCustomCode off 466 | RTWUseSimCustomCode off 467 | IncludeHyperlinkInReport off 468 | LaunchReport off 469 | PortableWordSizes off 470 | GenerateErtSFunction off 471 | CreateSILPILBlock "None" 472 | CodeExecutionProfiling off 473 | CodeExecutionProfileVariable "executionProfile" 474 | CodeProfilingSaveOptions "SummaryOnly" 475 | CodeProfilingInstrumentation off 476 | TargetLang "C" 477 | IncludeBusHierarchyInRTWFileBlockHierarchyMap off 478 | IncludeERTFirstTime off 479 | GenerateTraceInfo off 480 | GenerateTraceReport off 481 | GenerateTraceReportSl off 482 | GenerateTraceReportSf off 483 | GenerateTraceReportEml off 484 | GenerateCodeInfo off 485 | GenerateWebview off 486 | GenerateCodeMetricsReport off 487 | GenerateCodeReplacementReport off 488 | RTWCompilerOptimization "Off" 489 | CheckMdlBeforeBuild "Off" 490 | CustomRebuildMode "OnUpdate" 491 | Array { 492 | Type "Handle" 493 | Dimension 2 494 | Simulink.CodeAppCC { 495 | $ObjectID 16 496 | Version "1.12.1" 497 | Array { 498 | Type "Cell" 499 | Dimension 22 500 | Cell "IgnoreCustomStorageClasses" 501 | Cell "IgnoreTestpoints" 502 | Cell "InsertBlockDesc" 503 | Cell "InsertPolySpaceComments" 504 | Cell "SFDataObjDesc" 505 | Cell "MATLABFcnDesc" 506 | Cell "SimulinkDataObjDesc" 507 | Cell "DefineNamingRule" 508 | Cell "SignalNamingRule" 509 | Cell "ParamNamingRule" 510 | Cell "InternalIdentifier" 511 | Cell "InlinedPrmAccess" 512 | Cell "CustomSymbolStr" 513 | Cell "CustomSymbolStrGlobalVar" 514 | Cell "CustomSymbolStrType" 515 | Cell "CustomSymbolStrField" 516 | Cell "CustomSymbolStrFcn" 517 | Cell "CustomSymbolStrFcnArg" 518 | Cell "CustomSymbolStrBlkIO" 519 | Cell "CustomSymbolStrTmpVar" 520 | Cell "CustomSymbolStrMacro" 521 | Cell "ReqsInCode" 522 | PropName "DisabledProps" 523 | } 524 | ForceParamTrailComments off 525 | GenerateComments on 526 | IgnoreCustomStorageClasses on 527 | IgnoreTestpoints off 528 | IncHierarchyInIds off 529 | MaxIdLength 31 530 | PreserveName off 531 | PreserveNameWithParent off 532 | ShowEliminatedStatement off 533 | OperatorAnnotations off 534 | IncAutoGenComments off 535 | SimulinkDataObjDesc off 536 | SFDataObjDesc off 537 | MATLABFcnDesc off 538 | IncDataTypeInIds off 539 | MangleLength 1 540 | CustomSymbolStrGlobalVar "$R$N$M" 541 | CustomSymbolStrType "$N$R$M" 542 | CustomSymbolStrField "$N$M" 543 | CustomSymbolStrFcn "$R$N$M$F" 544 | CustomSymbolStrFcnArg "rt$I$N$M" 545 | CustomSymbolStrBlkIO "rtb_$N$M" 546 | CustomSymbolStrTmpVar "$N$M" 547 | CustomSymbolStrMacro "$R$N$M" 548 | DefineNamingRule "None" 549 | ParamNamingRule "None" 550 | SignalNamingRule "None" 551 | InsertBlockDesc off 552 | InsertPolySpaceComments off 553 | SimulinkBlockComments on 554 | MATLABSourceComments off 555 | EnableCustomComments off 556 | InternalIdentifier "Classic" 557 | InlinedPrmAccess "Literals" 558 | ReqsInCode off 559 | UseSimReservedNames off 560 | } 561 | Simulink.GRTTargetCC { 562 | $BackupClass "Simulink.TargetCC" 563 | $ObjectID 17 564 | Version "1.12.1" 565 | Array { 566 | Type "Cell" 567 | Dimension 15 568 | Cell "GeneratePreprocessorConditionals" 569 | Cell "IncludeMdlTerminateFcn" 570 | Cell "CombineOutputUpdateFcns" 571 | Cell "SuppressErrorStatus" 572 | Cell "ERTCustomFileBanners" 573 | Cell "GenerateSampleERTMain" 574 | Cell "GenerateTestInterfaces" 575 | Cell "ModelStepFunctionPrototypeControlCompliant" 576 | Cell "CPPClassGenCompliant" 577 | Cell "MultiInstanceERTCode" 578 | Cell "PurelyIntegerCode" 579 | Cell "SupportComplex" 580 | Cell "SupportAbsoluteTime" 581 | Cell "SupportContinuousTime" 582 | Cell "SupportNonInlinedSFcns" 583 | PropName "DisabledProps" 584 | } 585 | TargetFcnLib "ansi_tfl_table_tmw.mat" 586 | TargetLibSuffix "" 587 | TargetPreCompLibLocation "" 588 | CodeReplacementLibrary "ANSI_C" 589 | UtilityFuncGeneration "Auto" 590 | ERTMultiwordTypeDef "System defined" 591 | ERTMultiwordLength 256 592 | MultiwordLength 2048 593 | GenerateFullHeader on 594 | GenerateSampleERTMain off 595 | GenerateTestInterfaces off 596 | IsPILTarget off 597 | ModelReferenceCompliant on 598 | ParMdlRefBuildCompliant on 599 | CompOptLevelCompliant on 600 | ConcurrentExecutionCompliant on 601 | IncludeMdlTerminateFcn on 602 | GeneratePreprocessorConditionals "Disable all" 603 | CombineOutputUpdateFcns on 604 | CombineSignalStateStructs off 605 | SuppressErrorStatus off 606 | ERTFirstTimeCompliant off 607 | IncludeFileDelimiter "Auto" 608 | ERTCustomFileBanners off 609 | SupportAbsoluteTime on 610 | LogVarNameModifier "rt_" 611 | MatFileLogging on 612 | MultiInstanceERTCode off 613 | SupportNonFinite on 614 | SupportComplex on 615 | PurelyIntegerCode off 616 | SupportContinuousTime on 617 | SupportNonInlinedSFcns on 618 | SupportVariableSizeSignals off 619 | EnableShiftOperators on 620 | ParenthesesLevel "Nominal" 621 | ModelStepFunctionPrototypeControlCompliant off 622 | CPPClassGenCompliant off 623 | AutosarCompliant off 624 | GRTInterface off 625 | UseMalloc off 626 | ExtMode off 627 | ExtModeStaticAlloc off 628 | ExtModeTesting off 629 | ExtModeStaticAllocSize 1000000 630 | ExtModeTransport 0 631 | ExtModeMexFile "ext_comm" 632 | ExtModeIntrfLevel "Level1" 633 | RTWCAPISignals off 634 | RTWCAPIParams off 635 | RTWCAPIStates off 636 | RTWCAPIRootIO off 637 | GenerateASAP2 off 638 | } 639 | PropName "Components" 640 | } 641 | } 642 | hdlcoderui.hdlcc { 643 | $ObjectID 18 644 | Version "1.12.1" 645 | Description "HDL Coder custom configuration component" 646 | Name "HDL Coder" 647 | Array { 648 | Type "Cell" 649 | Dimension 1 650 | Cell "" 651 | PropName "HDLConfigFile" 652 | } 653 | HDLCActiveTab "0" 654 | } 655 | PropName "Components" 656 | } 657 | Name "Configuration" 658 | CurrentDlgPage "Solver" 659 | ConfigPrmDlgPosition [ 520, 225, 1400, 855 ] 660 | } 661 | PropName "ConfigurationSets" 662 | } 663 | ExplicitPartitioning off 664 | BlockDefaults { 665 | ForegroundColor "black" 666 | BackgroundColor "white" 667 | DropShadow off 668 | NamePlacement "normal" 669 | FontName "Helvetica" 670 | FontSize 10 671 | FontWeight "normal" 672 | FontAngle "normal" 673 | ShowName on 674 | BlockRotation 0 675 | BlockMirror off 676 | } 677 | AnnotationDefaults { 678 | HorizontalAlignment "center" 679 | VerticalAlignment "middle" 680 | ForegroundColor "black" 681 | BackgroundColor "white" 682 | DropShadow off 683 | FontName "Helvetica" 684 | FontSize 10 685 | FontWeight "normal" 686 | FontAngle "normal" 687 | UseDisplayTextAsClickCallback off 688 | } 689 | LineDefaults { 690 | FontName "Helvetica" 691 | FontSize 9 692 | FontWeight "normal" 693 | FontAngle "normal" 694 | } 695 | MaskDefaults { 696 | SelfModifiable "off" 697 | IconFrame "on" 698 | IconOpaque "on" 699 | RunInitForIconRedraw "off" 700 | IconRotate "none" 701 | PortRotate "default" 702 | IconUnits "autoscale" 703 | } 704 | MaskParameterDefaults { 705 | Evaluate "on" 706 | Tunable "on" 707 | NeverSave "off" 708 | Internal "off" 709 | ReadOnly "off" 710 | Enabled "on" 711 | Visible "on" 712 | ToolTip "on" 713 | } 714 | BlockParameterDefaults { 715 | Block { 716 | BlockType Inport 717 | Port "1" 718 | OutputFunctionCall off 719 | OutMin "[]" 720 | OutMax "[]" 721 | OutDataTypeStr "Inherit: auto" 722 | LockScale off 723 | BusOutputAsStruct off 724 | PortDimensions "-1" 725 | VarSizeSig "Inherit" 726 | SampleTime "-1" 727 | SignalType "auto" 728 | SamplingMode "auto" 729 | LatchByDelayingOutsideSignal off 730 | LatchInputForFeedbackSignals off 731 | Interpolate on 732 | } 733 | Block { 734 | BlockType MATLABFcn 735 | MATLABFcn "sin" 736 | OutputDimensions "-1" 737 | OutputSignalType "auto" 738 | Output1D on 739 | SampleTime "-1" 740 | } 741 | Block { 742 | BlockType Outport 743 | Port "1" 744 | OutMin "[]" 745 | OutMax "[]" 746 | OutDataTypeStr "Inherit: auto" 747 | LockScale off 748 | BusOutputAsStruct off 749 | PortDimensions "-1" 750 | VarSizeSig "Inherit" 751 | SampleTime "-1" 752 | SignalType "auto" 753 | SamplingMode "auto" 754 | SourceOfInitialOutputValue "Dialog" 755 | OutputWhenDisabled "held" 756 | InitialOutput "[]" 757 | } 758 | Block { 759 | BlockType SubSystem 760 | ShowPortLabels "FromPortIcon" 761 | Permissions "ReadWrite" 762 | PermitHierarchicalResolution "All" 763 | TreatAsAtomicUnit off 764 | CheckFcnCallInpInsideContextMsg off 765 | SystemSampleTime "-1" 766 | RTWFcnNameOpts "Auto" 767 | RTWFileNameOpts "Auto" 768 | RTWMemSecFuncInitTerm "Inherit from model" 769 | RTWMemSecFuncExecute "Inherit from model" 770 | RTWMemSecDataConstants "Inherit from model" 771 | RTWMemSecDataInternal "Inherit from model" 772 | RTWMemSecDataParameters "Inherit from model" 773 | SimViewingDevice off 774 | DataTypeOverride "UseLocalSettings" 775 | DataTypeOverrideAppliesTo "AllNumericTypes" 776 | MinMaxOverflowLogging "UseLocalSettings" 777 | SFBlockType "NONE" 778 | Variant off 779 | GeneratePreprocessorConditionals off 780 | } 781 | } 782 | System { 783 | Name "Fuzzy_Type2_Lib" 784 | Location [229, 96, 1343, 748] 785 | Open off 786 | ModelBrowserVisibility on 787 | ModelBrowserWidth 200 788 | ScreenColor "white" 789 | PaperOrientation "landscape" 790 | PaperPositionMode "auto" 791 | PaperType "usletter" 792 | PaperUnits "inches" 793 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 794 | TiledPageScale 1 795 | ShowPageBoundaries off 796 | ZoomFactor "100" 797 | ReportName "simulink-default.rpt" 798 | SIDHighWatermark "12" 799 | Block { 800 | BlockType SubSystem 801 | Name "Interval Type-2 Fuzzy Logic Controller" 802 | SID "1" 803 | Ports [1, 1] 804 | Position [15, 28, 160, 112] 805 | ZOrder 4 806 | LibraryVersion "1.10" 807 | MinAlgLoopOccurrences off 808 | PropExecContextOutsideSubsystem off 809 | RTWSystemCode "Auto" 810 | FunctionWithSeparateData off 811 | Opaque off 812 | RequestExecContextInheritance off 813 | MaskHideContents off 814 | Object { 815 | $PropName "MaskObject" 816 | $ObjectID 19 817 | $ClassName "Simulink.Mask" 818 | Type "Type-2 Fuzzy Logic Controller" 819 | Display "image(imread('MemberShipMask.jpg'))" 820 | Object { 821 | $PropName "Parameters" 822 | $ObjectID 20 823 | $ClassName "Simulink.MaskParameter" 824 | Type "edit" 825 | Name "t2fisSim" 826 | Prompt "t2fis name in Workspace or File Name " 827 | Value "0" 828 | Evaluate "off" 829 | Tunable "off" 830 | } 831 | } 832 | System { 833 | Name "Interval Type-2 Fuzzy Logic Controller" 834 | Location [229, 96, 1343, 748] 835 | Open on 836 | ModelBrowserVisibility on 837 | ModelBrowserWidth 200 838 | ScreenColor "white" 839 | PaperOrientation "landscape" 840 | PaperPositionMode "auto" 841 | PaperType "usletter" 842 | PaperUnits "inches" 843 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 844 | TiledPageScale 1 845 | ShowPageBoundaries off 846 | ZoomFactor "100" 847 | Block { 848 | BlockType Inport 849 | Name "Input" 850 | SID "2" 851 | Position [110, 103, 140, 117] 852 | ZOrder -1 853 | IconDisplay "Port number" 854 | } 855 | Block { 856 | BlockType MATLABFcn 857 | Name "t2fis" 858 | SID "8" 859 | Ports [1, 1] 860 | Position [230, 90, 330, 130] 861 | ZOrder 5 862 | MATLABFcn "evalt2(u,t2fisSim,0)" 863 | } 864 | Block { 865 | BlockType Outport 866 | Name "Output" 867 | SID "3" 868 | Position [400, 103, 430, 117] 869 | ZOrder -2 870 | IconDisplay "Port number" 871 | } 872 | Line { 873 | SrcBlock "Input" 874 | SrcPort 1 875 | DstBlock "t2fis" 876 | DstPort 1 877 | } 878 | Line { 879 | SrcBlock "t2fis" 880 | SrcPort 1 881 | DstBlock "Output" 882 | DstPort 1 883 | } 884 | } 885 | } 886 | Block { 887 | BlockType SubSystem 888 | Name "Interval Type-2 Fuzzy Logic Controller with TR selection" 889 | SID "9" 890 | Ports [1, 1] 891 | Position [255, 28, 400, 112] 892 | ZOrder 4 893 | MinAlgLoopOccurrences off 894 | PropExecContextOutsideSubsystem off 895 | RTWSystemCode "Auto" 896 | FunctionWithSeparateData off 897 | Opaque off 898 | RequestExecContextInheritance off 899 | MaskHideContents off 900 | Object { 901 | $PropName "MaskObject" 902 | $ObjectID 21 903 | $ClassName "Simulink.Mask" 904 | Type "Type-2 Fuzzy Logic Controller" 905 | Description "TR Method List for selection;\n\n1 - Karnik-Mendel Algorithm (KM)\n2 - Enhanced Karnik-Mendel Algorithm" 906 | "(EKM)\n3 - Iterative Algorithm with Stop Condition(IASC)\n4 - Enhanced Iterative Algorithm with Stop Condition(EIASC)" 907 | "\n5 - Enhanced Opposite Direction Searching Algorithm(EODS)\n6 - wu-Mendel Uncertainity Bound Method(WM)\n7 - Nie-Tan" 908 | " Method(NT)\n8 - Begain-Melek-Mendel Method(BMM)\n9 - User Defined Function" 909 | Display "image(imread('MemberShipMask.jpg'))" 910 | Array { 911 | Type "Simulink.MaskParameter" 912 | Dimension 2 913 | Object { 914 | $ObjectID 22 915 | Type "edit" 916 | Name "t2fisSim" 917 | Prompt "t2fis name in Workspace or File Name " 918 | Value "0" 919 | Evaluate "off" 920 | Tunable "off" 921 | } 922 | Object { 923 | $ObjectID 23 924 | Type "edit" 925 | Name "TRtype" 926 | Prompt "Select TR method" 927 | Value "0" 928 | Evaluate "off" 929 | Tunable "off" 930 | } 931 | PropName "Parameters" 932 | } 933 | } 934 | System { 935 | Name "Interval Type-2 Fuzzy Logic Controller with TR selection" 936 | Location [229, 96, 1343, 748] 937 | Open on 938 | ModelBrowserVisibility on 939 | ModelBrowserWidth 200 940 | ScreenColor "white" 941 | PaperOrientation "landscape" 942 | PaperPositionMode "auto" 943 | PaperType "usletter" 944 | PaperUnits "inches" 945 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 946 | TiledPageScale 1 947 | ShowPageBoundaries off 948 | ZoomFactor "100" 949 | Block { 950 | BlockType Inport 951 | Name "Input" 952 | SID "10" 953 | Position [110, 103, 140, 117] 954 | ZOrder -1 955 | IconDisplay "Port number" 956 | } 957 | Block { 958 | BlockType MATLABFcn 959 | Name "t2fis" 960 | SID "11" 961 | Ports [1, 1] 962 | Position [230, 90, 330, 130] 963 | ZOrder 5 964 | MATLABFcn "evalt2(u,t2fisSim,TRtype)" 965 | } 966 | Block { 967 | BlockType Outport 968 | Name "Output" 969 | SID "12" 970 | Position [400, 103, 430, 117] 971 | ZOrder -2 972 | IconDisplay "Port number" 973 | } 974 | Line { 975 | SrcBlock "t2fis" 976 | SrcPort 1 977 | DstBlock "Output" 978 | DstPort 1 979 | } 980 | Line { 981 | SrcBlock "Input" 982 | SrcPort 1 983 | DstBlock "t2fis" 984 | DstPort 1 985 | } 986 | } 987 | } 988 | } 989 | } 990 | -------------------------------------------------------------------------------- /Simulink_Lib/Fuzzy_Type2_Lib.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Simulink_Lib/Fuzzy_Type2_Lib.slx -------------------------------------------------------------------------------- /Simulink_Lib/MemberShipMask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Simulink_Lib/MemberShipMask.jpg -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/Type2FuzzyLogicSystems.rtw: -------------------------------------------------------------------------------- 1 | CompiledModel { 2 | Name "Type2FuzzyLogicSystems" 3 | OrigName "Type2FuzzyLogicSystems" 4 | Version "8.3 (R2012b) 20-Jul-2012" 5 | SimulinkVersion "8.0" 6 | ModelVersion "1.1" 7 | GeneratedOn "Thu Dec 18 15:10:07 2014" 8 | HasSimStructVars 0 9 | HasCodeVariants 0 10 | PreserveExternInFcnDecls 1 11 | ExprFolding 1 12 | TargetStyle "StandAloneTarget" 13 | NumDataStoresGlobalDSM 0 14 | RightClickBuild 0 15 | ModelReferenceTargetType "NONE" 16 | PILSimTargetUnification 0 17 | AllowNoArgFcnInReusedFcn 0 18 | StandaloneSSSupported 0 19 | StandaloneSubsystemTesting 0 20 | PadderActive 0 21 | DWorkAndBlockIOCombined 0 22 | PrmModelName SLDataModelName(Type2FuzzyLogicSystems) 23 | TrigSSSplitOutUpd 1 24 | UniqueFromFiles [] 25 | UniqueToFiles [] 26 | ErrorXMLMode 0 27 | BlockDiagramType model 28 | GlobalScope { 29 | tTIDType "int_T" 30 | tControlPortIdxType "int_T" 31 | tInf "rtInf" 32 | tInfType "real_T" 33 | tMinusInf "rtMinusInf" 34 | tMinusInfType "real_T" 35 | tNaN "rtNaN" 36 | tNaNType "real_T" 37 | tChildSimStruct "rts" 38 | tTID "tid" 39 | tControlPortIdx "controlPortIdx" 40 | tChildModels "childModels" 41 | tParametersType "Parameters_Type2FuzzyLogicSyste" 42 | tBlockIOType "BlockIO_Type2FuzzyLogicSystems" 43 | tContStateType "ContinuousStates_Type2FuzzyLogi" 44 | tXdotType "StateDerivatives_Type2FuzzyLogi" 45 | tXdisType "StateDisabled_Type2FuzzyLogicSy" 46 | tXAbsTolType "CStateAbsTol_Type2FuzzyLogicSys" 47 | tOutputType "ExternalOutputs_Type2FuzzyLogic" 48 | tOutputSizeType "ExternalOutputSizes_Type2FuzzyL" 49 | tDWorkType "D_Work_Type2FuzzyLogicSystems" 50 | tPrevZCStateType "PrevZCSigStates_Type2FuzzyLogic" 51 | tZCSignalValueType "ZCSignalValues_Type2FuzzyLogicS" 52 | tMassMatrixGlobalType "MassMatrixGlobal_Type2FuzzyLogi" 53 | tConstBlockIOType "ConstBlockIO_Type2FuzzyLogicSys" 54 | tConstParamType "ConstParam_Type2FuzzyLogicSyste" 55 | tConstParamWithInitType "ConstParamWithInit_Type2FuzzyLo" 56 | tMdlRefTimingBridgeType "rtTimingBridge_Type2FuzzyLogicS" 57 | tMachineLocalDataType "MachineLocalData_Type2FuzzyLogi" 58 | tDefaultParameters "Type2FuzzyLog_DefaultParameters" 59 | tBlockIO "Type2FuzzyLogicSystems_B" 60 | tContState "Type2FuzzyLogicSystems_X" 61 | tXdot "Type2FuzzyLogicSystems_Xdot" 62 | tXdis "Type2FuzzyLogicSystems_Xdis" 63 | tXAbsTol "Type2FuzzyLogicSystems_XAbsTol" 64 | tOutput "Type2FuzzyLogicSystems_Y" 65 | tOutputSize "Type2FuzzyLogicSystems_YSize" 66 | tDWork "Type2FuzzyLogicSystems_DWork" 67 | tPrevZCState "Type2FuzzyLogicS_PrevZCSigState" 68 | tZCSignalValue "Type2FuzzyLogicSy_ZCSignalValue" 69 | tMassMatrixGlobal "Type2FuzzyLogi_MassMatrixGlobal" 70 | tODE8Const "Type2FuzzyLogicSystems_NSTAGES" 71 | tConstParamStruct "Type2FuzzyLogicSystems_ConstP" 72 | tConstParamWithInitStruct "Type2FuzzyLogicS_ConstWithInitP" 73 | tInvariantSignals "Type2FuzzyLogi_InvariantSignals" 74 | tMdlRefTimingBridge "Type2FuzzyLogicSys_TimingBridge" 75 | tMdlRefGlobalTID "Type2FuzzyLogicSystem_GlobalTID" 76 | tModelObject "Type2FuzzyLogicSystems_Object" 77 | tMachineLocalData "Type2FuzzyLogicSystems_Machine" 78 | tInputType "ExternalInputs_Type2FuzzyLogicS" 79 | tInputSizeType "ExternalInputSizes_Type2FuzzyLo" 80 | tSimStructType "RT_MODEL_Type2FuzzyLogicSystems" 81 | tSimStructTypeTag "tag_RTM_Type2FuzzyLogicSystems" 82 | tInput "Type2FuzzyLogicSystems_U" 83 | tInputSize "Type2FuzzyLogicSystems_USize" 84 | tSimStruct "Type2FuzzyLogicSystems_M" 85 | tConstBlockIOStruct "Type2FuzzyLogicSystems_ConstB" 86 | tConstBlockIODefine "Type2FuzzyLogicSystems_ConstB" 87 | tParameters "Type2FuzzyLogicSystems_P" 88 | } 89 | ConfigSet { 90 | AutosarCompliant 0 91 | BitfieldContainerType "uint_T" 92 | BlockReduction 1 93 | BooleanDataType 1 94 | BooleansAsBitfields 0 95 | BufferReusableBoundary 1 96 | BufferReuse 1 97 | CPPClassGenCompliant 0 98 | CodeExecutionProfiling 0 99 | CodeGenDirectory "" 100 | CodeProfilingInstrumentation 0 101 | CodeReplacementLibrary "ANSI_C" 102 | CombineOutputUpdateFcns 1 103 | CombineSignalStateStructs 0 104 | CompOptLevelCompliant 1 105 | ConcurrentExecutionCompliant 1 106 | ConditionallyExecuteInputs 1 107 | CustomCommentsFcn "" 108 | CustomHeaderCode "" 109 | CustomInclude "" 110 | CustomInitializer "" 111 | CustomLibrary "" 112 | CustomSource "" 113 | CustomSourceCode "" 114 | CustomSymbolStrBlkIO "rtb_$N$M" 115 | CustomSymbolStrFcn "$R$N$M$F" 116 | CustomSymbolStrFcnArg "rt$I$N$M" 117 | CustomSymbolStrField "$N$M" 118 | CustomSymbolStrGlobalVar "$R$N$M" 119 | CustomSymbolStrMacro "$R$N$M" 120 | CustomSymbolStrTmpVar "$N$M" 121 | CustomSymbolStrType "$N$R$M" 122 | CustomTerminator "" 123 | DataBitsets 0 124 | DataInitializer "" 125 | DefineNamingFcn "" 126 | DefineNamingRule "None" 127 | ERTCustomFileBanners 0 128 | ERTFirstTimeCompliant 0 129 | ERTMultiwordLength 256 130 | ERTMultiwordTypeDef "System defined" 131 | EfficientFloat2IntCast 0 132 | EfficientMapNaN2IntZero 1 133 | EnableCustomComments 0 134 | EnableMemcpy 1 135 | EnableParallelModelReferenceBuilds 0 136 | EnhancedBackFolding 0 137 | EvaledLifeSpan rtInf 138 | ExpressionFolding 1 139 | ExtMode 0 140 | ExtModeIntrfLevel "Level1" 141 | ExtModeMexArgs "" 142 | ExtModeMexFile "ext_comm" 143 | ExtModeStaticAlloc 0 144 | ExtModeStaticAllocSize 1000000 145 | ExtModeTransport 0 146 | FoldNonRolledExpr 1 147 | ForceParamTrailComments 0 148 | GRTInterface 0 149 | GenerateASAP2 0 150 | GenerateClassInterface 0 151 | GenerateCodeInfo 0 152 | GenerateCodeMetricsReport 0 153 | GenerateCodeReplacementReport 0 154 | GenerateComments 1 155 | GenerateErtSFunction 0 156 | GeneratePreprocessorConditionals "Disable all" 157 | GenerateReport 0 158 | GenerateSampleERTMain 0 159 | GenerateTestInterfaces 0 160 | GenerateTraceInfo 0 161 | GenerateTraceReport 0 162 | GenerateTraceReportEml 0 163 | GenerateTraceReportSf 0 164 | GenerateTraceReportSl 0 165 | GenerateWebview 0 166 | IgnoreCustomStorageClasses 1 167 | IgnoreTestpoints 0 168 | IncAutoGenComments 0 169 | IncDataTypeInIds 0 170 | IncHierarchyInIds 0 171 | IncludeERTFirstTime 0 172 | IncludeFileDelimiter "Auto" 173 | IncludeHyperlinkInReport 0 174 | IncludeMdlTerminateFcn 1 175 | InitFltsAndDblsToZero 0 176 | InlineInvariantSignals 0 177 | InlineParams 0 178 | InlinedPrmAccess "Literals" 179 | InsertBlockDesc 0 180 | InsertPolySpaceComments 0 181 | IsERTTarget 0 182 | IsPILTarget 0 183 | LaunchReport 0 184 | LifeSpan "inf" 185 | LocalBlockOutputs 1 186 | LogVarNameModifier "rt_" 187 | MangleLength 1 188 | MatFileLogging 1 189 | MaxIdLength 31 190 | MemcpyThreshold 64 191 | ModelReferenceCompliant 1 192 | ModelStepFunctionPrototypeControlCompliant 0 193 | MultiInstanceERTCode 0 194 | MultiwordLength 2048 195 | NoFixptDivByZeroProtection 0 196 | OperatorAnnotations 0 197 | OptimizeBlockIOStorage 1 198 | OptimizeModelRefInitCode 0 199 | ParMdlRefBuildCompliant 1 200 | ParallelModelReferenceErrorOnInvalidPool 1 201 | ParamNamingFcn "" 202 | ParamNamingRule "None" 203 | ParenthesesLevel "Nominal" 204 | PassReuseOutputArgsAs "Structure reference" 205 | PassReuseOutputArgsThreshold 12 206 | PortableWordSizes 0 207 | PreserveName 0 208 | PreserveNameWithParent 0 209 | ProdBitPerChar 8 210 | ProdBitPerDouble 64 211 | ProdBitPerFloat 32 212 | ProdBitPerInt 32 213 | ProdBitPerLong 32 214 | ProdBitPerPointer 32 215 | ProdBitPerShort 16 216 | ProdEndianess "Unspecified" 217 | ProdEqTarget 1 218 | ProdHWDeviceType "32-bit Generic" 219 | ProdIntDivRoundTo "Undefined" 220 | ProdLargestAtomicFloat "None" 221 | ProdLargestAtomicInteger "Char" 222 | ProdShiftRightIntArith 1 223 | ProdWordSize 32 224 | ProfileTLC 0 225 | PurelyIntegerCode 0 226 | RTWCAPIParams 0 227 | RTWCAPIRootIO 0 228 | RTWCAPISignals 0 229 | RTWCAPIStates 0 230 | ReqsInCode 0 231 | RollThreshold 5 232 | SFDataObjDesc 0 233 | ShowEliminatedStatement 0 234 | SignalNamingFcn "" 235 | SignalNamingRule "None" 236 | SimulinkBlockComments 1 237 | SimulinkDataObjDesc 0 238 | SolverJacobianMethodControl "auto" 239 | StateBitsets 0 240 | StrengthReduction 0 241 | SupportAbsoluteTime 1 242 | SupportComplex 1 243 | SupportContinuousTime 1 244 | SupportNonFinite 1 245 | SupportNonInlinedSFcns 1 246 | SupportVariableSizeSignals 0 247 | SuppressErrorStatus 0 248 | SystemCodeInlineAuto 0 249 | SystemTargetFile "grt.tlc" 250 | TLCAssert 0 251 | TLCCoverage 0 252 | TLCDebug 0 253 | TargetBitPerChar 8 254 | TargetBitPerDouble 64 255 | TargetBitPerFloat 32 256 | TargetBitPerInt 32 257 | TargetBitPerLong 32 258 | TargetBitPerPointer 32 259 | TargetBitPerShort 16 260 | TargetEndianess "Unspecified" 261 | TargetFcnLib "ansi_tfl_table_tmw.mat" 262 | TargetHWDeviceType "32-bit Generic" 263 | TargetIntDivRoundTo "Undefined" 264 | TargetLang "C" 265 | TargetLargestAtomicFloat "None" 266 | TargetLargestAtomicInteger "Char" 267 | TargetLibSuffix "" 268 | TargetPreCompLibLocation "" 269 | TargetPreprocMaxBitsSint 32 270 | TargetPreprocMaxBitsUint 32 271 | TargetShiftRightIntArith 1 272 | TargetTypeEmulationWarnSuppressLevel 0 273 | TargetUnknown 0 274 | TargetWordSize 32 275 | UseFloatMulNetSlope 0 276 | UseIntDivNetSlope 0 277 | UseSimReservedNames 0 278 | UseSpecifiedMinMax 0 279 | UseTempVars 0 280 | UtilityFuncGeneration "Auto" 281 | ZeroCrossAlgorithm "Nonadaptive" 282 | ZeroCrossControl "UseLocalSettings" 283 | ZeroExternalMemoryAtStartup 1 284 | ZeroInternalMemoryAtStartup 1 285 | Diagnostics { 286 | AlgebraicLoopMsg "warning" 287 | ArrayBoundsChecking "none" 288 | ArtificialAlgebraicLoopMsg "warning" 289 | AssertControl "UseLocalSettings" 290 | BlockIODiagnostic "none" 291 | BlockPriorityViolationMsg "warning" 292 | BusNameAdapt "WarnAndRepair" 293 | BusObjectLabelMismatch "warning" 294 | CheckMatrixSingularityMsg "none" 295 | ConsistencyChecking "none" 296 | DiscreteInheritContinuousMsg "warning" 297 | FcnCallInpInsideContextMsg "EnableAllAsError" 298 | FixptConstOverflowMsg "none" 299 | FixptConstPrecisionLossMsg "none" 300 | FixptConstUnderflowMsg "none" 301 | FrameProcessingCompatibilityMsg "warning" 302 | IgnoredZcDiagnostic "warning" 303 | InheritedTsInSrcMsg "warning" 304 | InitInArrayFormatMsg "warning" 305 | Int32ToFloatConvMsg "warning" 306 | IntegerOverflowMsg "warning" 307 | InvalidFcnCallConnMsg "error" 308 | LoggingUnavailableSignals "error" 309 | MaskedZcDiagnostic "warning" 310 | MaxConsecutiveZCsMsg "error" 311 | MergeDetectMultiDrivingBlocksExec "none" 312 | MinStepSizeMsg "warning" 313 | ModelReferenceCSMismatchMessage "none" 314 | ModelReferenceDataLoggingMessage "warning" 315 | ModelReferenceExtraNoncontSigs "error" 316 | ModelReferenceIOMismatchMessage "none" 317 | ModelReferenceIOMsg "none" 318 | ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error" 319 | ModelReferenceSymbolNameMessage "warning" 320 | ModelReferenceVersionMismatchMessage "none" 321 | MultiTaskCondExecSysMsg "error" 322 | MultiTaskDSMMsg "error" 323 | MultiTaskRateTransMsg "error" 324 | NonBusSignalsTreatedAsBus "none" 325 | ParameterDowncastMsg "error" 326 | ParameterOverflowMsg "error" 327 | ParameterPrecisionLossMsg "warning" 328 | ParameterTunabilityLossMsg "warning" 329 | ParameterUnderflowMsg "none" 330 | RTPrefix "error" 331 | ReadBeforeWriteMsg "UseLocalSettings" 332 | RootOutportRequireBusObject "warning" 333 | SFInvalidInputDataAccessInChartInitDiag "warning" 334 | SFMismatchInSimAndRtwBecauseOfMissingDataTypeDiag "warning" 335 | SFNoUnconditionalDefaultTransitionDiag "warning" 336 | SFTransitionActionBeforeConditionDiag "warning" 337 | SFTransitionOutsideNaturalParentDiag "warning" 338 | SFUnconditionalTransitionShadowingDiag "warning" 339 | SFUndirectedBroadcastEventsDiag "warning" 340 | SFUnexpectedBacktrackingDiag "warning" 341 | SFUnusedDataAndEventsDiag "warning" 342 | SFcnCompatibilityMsg "none" 343 | SaveWithDisabledLinksMsg "warning" 344 | SaveWithParameterizedLinksMsg "warning" 345 | SigSpecEnsureSampleTimeMsg "warning" 346 | SignalInfNanChecking "none" 347 | SignalLabelMismatchMsg "none" 348 | SignalRangeChecking "none" 349 | SignalResolutionControl "UseLocalSettings" 350 | SimStateContentChecksumMismatchMsg "error" 351 | SimStateInterfaceChecksumMismatchMsg "warning" 352 | SimStateOlderReleaseMsg "error" 353 | SingleTaskRateTransMsg "none" 354 | SolverPrmCheckMsg "warning" 355 | StateNameClashWarn "warning" 356 | StrictBusMsg "ErrorLevel1" 357 | TasksWithSamePriorityMsg "warning" 358 | TimeAdjustmentMsg "none" 359 | UnconnectedInputMsg "warning" 360 | UnconnectedLineMsg "warning" 361 | UnconnectedOutputMsg "warning" 362 | UnderSpecifiedDataTypeMsg "none" 363 | UnderspecifiedInitializationDetection "none" 364 | UniqueDataStoreMsg "none" 365 | UnknownTsInhSupMsg "warning" 366 | UnnecessaryDatatypeConvMsg "none" 367 | VectorMatrixConversionMsg "none" 368 | WriteAfterReadMsg "UseLocalSettings" 369 | WriteAfterWriteMsg "UseLocalSettings" 370 | } 371 | } 372 | Solver FixedStepDiscrete 373 | SolverType FixedStep 374 | StartTime 0.0 375 | StopTime 10.0 376 | LoadInitialState no 377 | SolverConsistencyChecking no 378 | SolverZeroCrossDetection Nonadaptive 379 | LifeSpan rtInf 380 | SolverResetMethod fast 381 | SolverUpdateJacobianAtReset no 382 | FixedStepOpts { 383 | SolverMode SingleTasking 384 | FixedStep 0.1 385 | ExtrapolationOrder -1 386 | NumberNewtonIterations -1 387 | TID01EQ 1 388 | DoRTWSFcnTID01EQCheck 0 389 | } 390 | RTWGenSettings { 391 | BuildDirSuffix "_grt_rtw" 392 | CodeFormat "RealTime" 393 | DisableBuildDirOverride "no" 394 | DivideStackByRate "0" 395 | GenRTModel "1" 396 | GeneratedTLCSubDir "tlc" 397 | MaxConstBOSize "Inf" 398 | MaxStackSize "Inf" 399 | MaxStackVariableSize "4096" 400 | ModelReferenceDirSuffix "" 401 | ModelReferenceTargetType "NONE" 402 | ProfileGenCode "0" 403 | ProtectCallInitFcnTwice "0" 404 | RelativeBuildDir "Type2FuzzyLogicSystems_grt_rtw" 405 | matFileLogging "1" 406 | mdlRefHDLDir "hdl" 407 | mdlRefSimDir "sim" 408 | mdlRefTgtDir "grt" 409 | model "Type2FuzzyLogicSystems" 410 | parMdlRefCfgCheckFcn "grt_par_cfg_chk" 411 | relativePathToAnchor "" 412 | tlcLanguage "C" 413 | tlcTargetType "RT" 414 | } 415 | RTWContext [1456041432, 0] 416 | RTWCGIR 1 417 | TLCBlkFcnInCGIR 1 418 | SLCI off 419 | SubsystemHdlForRightClickBuild 0.0 420 | DataLoggingOpts { 421 | SaveFormat 0 422 | MaxRows 1000 423 | Decimation 1 424 | TimeSaveName "tout" 425 | OutputSaveName "" 426 | NumOutputSaveNames 0 427 | StateSaveName "" 428 | FinalStateName "" 429 | NumLoggedStates 0 430 | SignalLoggingName "" 431 | SignalLoggingSaveFormat "Dataset" 432 | CompiledSignalLoggingSaveFormat "Dataset" 433 | } 434 | NumModelInputs 0 435 | NumModelOutputs 0 436 | NumNonVirtBlocksInModel 3 437 | DirectFeedthrough no 438 | NumContStates 0 439 | ModelHasProjections no 440 | ModelIsLinearlyImplicit no 441 | ModelMassMatrixType 0 442 | ModelMassMatrixNzMax 0 443 | ZCFindingDisabled yes 444 | NumNonsampledZCs 0 445 | NumZCEvents 0 446 | ZCVectorlength 0 447 | NumBlockSignals 3 448 | NumBlockParams 2 449 | NumAlgebraicLoops 0 450 | CoderReportInfo 1 451 | HasRootTriggerPort no 452 | HasRootEnablePort no 453 | RootTriggerType "" 454 | IsAPERRootTriggeredSystem no 455 | RootTriggerTsType "" 456 | AllSampleTimesInherited yes 457 | ModelSampleTimeInheritanceDetails { 458 | AllowedOverall no 459 | IsMultiRate yes 460 | NeedsAbsTime no 461 | HasPreSetSampleTimes yes 462 | HasContinuousTs yes 463 | BlockDisallows no 464 | HasBlockWithUnknownTsSupport no 465 | ConstInterfaceNonConstContents no 466 | InheritanceForcedForFcnCall no 467 | } 468 | InvariantConstants no 469 | FundamentalStepSize 0.1 470 | SingleRate yes 471 | NumSampleTimes 2 472 | PositivePriority no 473 | ConcurrentTasks no 474 | SampleTime { 475 | TID 0 476 | PriorityAssigned yes 477 | Priority 39 478 | PeriodAndOffset [0.0, 0.0] 479 | Asynchronous no 480 | IsUnionTs no 481 | TimeSource Self_internal 482 | AsyncPromotedTID 0 483 | TimerUpdateCode "" 484 | ClockTickStepSize 0.1 485 | NeedAbsoluteTime yes 486 | NeedFloatTime yes 487 | ClockTickDataTypeId 13 488 | ClockTickDataTypeAtomic 0 489 | TaskCounterDataTypeId 3 490 | } 491 | SampleTime { 492 | TID 1 493 | PriorityAssigned yes 494 | Priority 40 495 | PeriodAndOffset [0.1, 0.0] 496 | Asynchronous no 497 | IsUnionTs no 498 | TimeSource Self_internal 499 | AsyncPromotedTID 1 500 | TimerUpdateCode "" 501 | ClockTickStepSize 0.1 502 | NeedAbsoluteTime yes 503 | NeedFloatTime no 504 | ClockTickDataTypeId 13 505 | ClockTickDataTypeAtomic 0 506 | TaskCounterDataTypeId 3 507 | } 508 | NumVariableSampleTimes 0 509 | NumAsynchronousSampleTimes 0 510 | NumSynchronousSampleTimes 2 511 | HasBlocksWithDiscreteSampleTime yes 512 | MdlGenRateGroupingCode no 513 | DataTypes { 514 | NumDataTypes 14 515 | NumSLBuiltInDataTypes 9 516 | StrictBooleanCheckEnabled 1 517 | BitfieldContainerType uint_T 518 | DataTypeDefaults { 519 | IdAliasedTo -10 520 | GroundHasNonZero 1 521 | Checksum [0U, 0U, 0U, 0U] 522 | NumElements 0 523 | IsBus 0 524 | IsEnumType 0 525 | EnumStorageTypeId -1 526 | IsNumericType 1 527 | IsFixedPoint 0 528 | IsSigned 1 529 | FixedExp 0 530 | FracSlope 1.0 531 | Bias 0.0 532 | HasObject 0 533 | DataScope "" 534 | HeaderFile "" 535 | DefinedInLegacyCode 0 536 | } 537 | ElementsDefaults { 538 | Padding 0 539 | CGTypeIdx 0 540 | Max rtInf 541 | Min rtMinusInf 542 | Description "" 543 | DocUnits "" 544 | } 545 | DataType { 546 | DTName "double" 547 | Id 0 548 | Size 8 549 | IdAliasedThruTo 0 550 | GroundHasNonZero 0 551 | GroundValueBin [0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U] 552 | StorageId 0 553 | RequiredBits 64 554 | } 555 | DataType { 556 | DTName "single" 557 | Id 1 558 | Size 4 559 | IdAliasedThruTo 1 560 | GroundHasNonZero 0 561 | GroundValueBin [0U, 0U, 0U, 0U] 562 | StorageId 1 563 | RequiredBits 32 564 | } 565 | DataType { 566 | DTName "int8" 567 | Id 2 568 | Size 1 569 | IdAliasedThruTo 2 570 | GroundHasNonZero 0 571 | GroundValueBin [0U] 572 | StorageId 2 573 | RequiredBits 8 574 | } 575 | DataType { 576 | DTName "uint8" 577 | Id 3 578 | Size 1 579 | IdAliasedThruTo 3 580 | GroundHasNonZero 0 581 | GroundValueBin [0U] 582 | StorageId 3 583 | IsSigned 0 584 | RequiredBits 8 585 | } 586 | DataType { 587 | DTName "int16" 588 | Id 4 589 | Size 2 590 | IdAliasedThruTo 4 591 | GroundHasNonZero 0 592 | GroundValueBin [0U, 0U] 593 | StorageId 4 594 | RequiredBits 16 595 | } 596 | DataType { 597 | DTName "uint16" 598 | Id 5 599 | Size 2 600 | IdAliasedThruTo 5 601 | GroundHasNonZero 0 602 | GroundValueBin [0U, 0U] 603 | StorageId 5 604 | IsSigned 0 605 | RequiredBits 16 606 | } 607 | DataType { 608 | DTName "int32" 609 | Id 6 610 | Size 4 611 | IdAliasedThruTo 6 612 | GroundHasNonZero 0 613 | GroundValueBin [0U, 0U, 0U, 0U] 614 | StorageId 6 615 | RequiredBits 32 616 | } 617 | DataType { 618 | DTName "uint32" 619 | Id 7 620 | Size 4 621 | IdAliasedThruTo 7 622 | GroundHasNonZero 0 623 | GroundValueBin [0U, 0U, 0U, 0U] 624 | StorageId 7 625 | IsSigned 0 626 | RequiredBits 32 627 | } 628 | DataType { 629 | DTName "boolean" 630 | Id 8 631 | Size 1 632 | IdAliasedThruTo 8 633 | GroundHasNonZero 0 634 | GroundValueBin [0U] 635 | StorageId 8 636 | IsSigned 0 637 | RequiredBits 8 638 | } 639 | DataType { 640 | DTName "fcn_call" 641 | Id 9 642 | Size 8 643 | IdAliasedThruTo 9 644 | StorageId 9 645 | IsNumericType 0 646 | } 647 | DataType { 648 | DTName "integer" 649 | Id 10 650 | Size 4 651 | IdAliasedThruTo 10 652 | StorageId 10 653 | IsNumericType 0 654 | } 655 | DataType { 656 | DTName "pointer" 657 | Id 11 658 | Size 4 659 | IdAliasedThruTo 11 660 | StorageId 11 661 | IsNumericType 0 662 | } 663 | DataType { 664 | DTName "action" 665 | Id 12 666 | Size 8 667 | IdAliasedThruTo 12 668 | StorageId 12 669 | IsNumericType 0 670 | } 671 | DataType { 672 | DTName "timer_uint32_pair" 673 | Id 13 674 | Size 8 675 | IdAliasedThruTo 13 676 | StorageId 13 677 | IsNumericType 0 678 | } 679 | } 680 | TargetProperties { 681 | HasObject 0 682 | } 683 | HasEcoderProperties 0 684 | NumBlockTypeCounts 2 685 | BlockTypeCount { 686 | Type "Constant" 687 | Count 2 688 | } 689 | BlockTypeCount { 690 | Type "MATLABFcn" 691 | Count 1 692 | } 693 | BlockHierarchyMap { 694 | SignalHierarchyDescriptorDefaults { 695 | NumHierarchyNodes 1 696 | Virtual 0 697 | Synthesized 0 698 | _blkref [-1, -1, -1] 699 | GrSrc [-1, -1] 700 | } 701 | HierarchyNodeDefaults { 702 | NumRegions 0 703 | SignalLabel "" 704 | } 705 | SubsystemDefaults { 706 | Type virtual 707 | MaskType "" 708 | NumBlocks 0 709 | NumInportBlocks 0 710 | NumOutportBlocks 0 711 | NumDataStoreBlocks 0 712 | NumSubsystemBlocks 0 713 | NumChildSubsystems 0 714 | SLContextSysNum 0 715 | NVOwnerSysIdx -1 716 | } 717 | BlockDefaults { 718 | Virtual 0 719 | _blkref [-1, -1, -1] 720 | _callsiteidx 0 721 | NumDataInputPorts 0 722 | NumControlInputPorts 0 723 | NumDataOutputPorts 1 724 | NumFcnCallOutputPorts 0 725 | NumParameters 0 726 | NumContStates 0 727 | NumDerivatives 0 728 | NumDiscStates 0 729 | NumDataStores 0 730 | NumDWorks 0 731 | Description "" 732 | } 733 | DataInputPortDefaults { 734 | SLName "" 735 | SignalLabel "" 736 | Connected 1 737 | NumRegions 0 738 | TestPoint 0 739 | MdlRefSimLoggableTestPoint 0 740 | } 741 | ControlInputPortDefaults { 742 | SLName "" 743 | SignalLabel "" 744 | Connected 1 745 | NumRegions 0 746 | TestPoint 0 747 | MdlRefSimLoggableTestPoint 0 748 | } 749 | DataOutputPortDefaults { 750 | SLName "" 751 | SignalLabel "" 752 | Connected 1 753 | NumRegions 0 754 | TestPoint 0 755 | MdlRefSimLoggableTestPoint 0 756 | } 757 | RegionDefaults { 758 | Offset 0 759 | Dimensions [1, 1] 760 | MemoryMapIdx [-1, -1, -1] 761 | } 762 | ParameterDefaults { 763 | IsReference 0 764 | MemoryMapIdx [-1, -1, -1] 765 | } 766 | ContStateDefaults { 767 | Dimensions [1, 1] 768 | MemoryMapIdx [-1, -1, -1] 769 | } 770 | DerivativeDefaults { 771 | Dimensions [1, 1] 772 | MemoryMapIdx [-1, -1, -1] 773 | } 774 | DiscStateDefaults { 775 | Dimensions [1, 1] 776 | MemoryMapIdx [-1, -1, -1] 777 | } 778 | DWorkDefaults { 779 | Dimensions [1, 1] 780 | MemoryMapIdx [-1, -1, -1] 781 | } 782 | DataStoreDefaults { 783 | Dimensions [1, 1] 784 | MemoryMapIdx [-1, -1, -1] 785 | } 786 | Subsystem { 787 | Name "" 788 | SLName "Type2FuzzyLogicSystems" 789 | Type root 790 | SubsystemBlockIndex [-1, -1] 791 | NVOwnerSysIdx 0 792 | NumBlocks 3 793 | NumSubsystemBlocks 1 794 | SubsystemBlocks [0] 795 | NumChildSubsystems 1 796 | ChildSubsystems [1] 797 | Block { 798 | Name "/Fuzzy Type-2 Controller" 799 | SLName "Fuzzy Type-2 Controller" 800 | SID "1" 801 | Type SubSystem 802 | Virtual 1 803 | NumDataInputPorts 2 804 | DataInputPort { 805 | SLName "In1" 806 | } 807 | DataInputPort { 808 | SLName "In2" 809 | } 810 | DataOutputPort { 811 | SLName "Out1" 812 | } 813 | } 814 | Block { 815 | Name "/Input 1" 816 | SLName "Input 1" 817 | SID "5" 818 | Type Constant 819 | _blkref [0, -1, 0] 820 | DataOutputPort { 821 | } 822 | Parameter { 823 | Name "Value" 824 | _idx 0 825 | } 826 | NumParameters 1 827 | } 828 | Block { 829 | Name "/Input 2" 830 | SLName "Input 2" 831 | SID "6" 832 | Type Constant 833 | _blkref [0, -1, 1] 834 | DataOutputPort { 835 | } 836 | Parameter { 837 | Name "Value" 838 | _idx 1 839 | } 840 | NumParameters 1 841 | } 842 | } 843 | Subsystem { 844 | Name "/Fuzzy Type-2 Controller" 845 | SLName "Fuzzy Type-2 Controller" 846 | SubsystemBlockIndex [0, 0] 847 | NVOwnerSysIdx 0 848 | NumBlocks 1 849 | NumSubsystemBlocks 1 850 | SubsystemBlocks [0] 851 | NumChildSubsystems 1 852 | ChildSubsystems [2] 853 | Block { 854 | Name "/t2fis" 855 | SLName "t2fis" 856 | SID "8" 857 | Type SubSystem 858 | Virtual 1 859 | NumDataInputPorts 1 860 | DataInputPort { 861 | SLName "Input" 862 | } 863 | DataOutputPort { 864 | SLName "Output" 865 | } 866 | } 867 | } 868 | Subsystem { 869 | Name "/t2fis" 870 | SLName "t2fis" 871 | MaskType "Type-2 Fuzzy Logic Controller" 872 | SubsystemBlockIndex [1, 0] 873 | NVOwnerSysIdx 0 874 | NumBlocks 1 875 | Block { 876 | Name "/t2fis" 877 | SLName "t2fis" 878 | SID "8:8" 879 | Type MATLABFcn 880 | _blkref [0, -1, 2] 881 | NumDataInputPorts 1 882 | DataInputPort { 883 | } 884 | DataOutputPort { 885 | } 886 | } 887 | } 888 | NumSubsystems 3 889 | } 890 | ExternalInputs { 891 | ExternalInputDefaults { 892 | RecordType ExternalInput 893 | MemoryMapIdx [-1,-1,-1] 894 | HasObject 0 895 | CGTypeIdx 0 896 | Invariant no 897 | Interpolation 1 898 | RequiresGlobalAccess yes 899 | FrameData no 900 | DirectFeedThrough yes 901 | SigLabel "" 902 | OrigIdentifier "" 903 | StorageClass Auto 904 | CustomStorageClassVersion 0 905 | TestPoint no 906 | StorageTypeQualifier "" 907 | InitialValue [] 908 | FunctionCallInitiator no 909 | Padding 0 910 | Alignment -1 911 | ContextTID 0 912 | SysNum 0 913 | } 914 | NumExternalInputs 0 915 | StructAlignment -1 916 | } 917 | ExternalOutputs { 918 | ExternalOutputDefaults { 919 | RecordType ExternalOutput 920 | CGTypeIdx 0 921 | MemoryMapIdx [-1,-1,-1] 922 | SigLabel "" 923 | HasObject 0 924 | FrameData no 925 | RequiresGlobalAccess yes 926 | Padding 0 927 | Alignment -1 928 | } 929 | NumExternalOutputs 0 930 | StructAlignment -1 931 | } 932 | BlockOutputs { 933 | GlobalBlockOutputDefaults { 934 | RecordType BlockOutput 935 | SigSrc [] 936 | GrSrc [-1, -1, -1, -1] 937 | IsSynthesized 0 938 | OwnerSysIdx [-1,-1] 939 | MemoryMapIdx [-1,-1,-1] 940 | HasObject 0 941 | TestPoint no 942 | ConstExpr 0 943 | OrigIdentifier "" 944 | StorageClass "Auto" 945 | Alignment -1 946 | CustomStorageClassVersion 0 947 | StorageTypeQualifier "" 948 | DrivesModelRefRootOutport no 949 | DrivesModelRefRootOutportNum -1 950 | DrivesRootOutport no 951 | IdentifierScope "top-level" 952 | Invariant no 953 | DeclareAsPointer no 954 | BitFieldWidth 0 955 | InitialValue [] 956 | InitInStart 0 957 | CGTypeIdx 0 958 | SigLabel "" 959 | SigConnected all 960 | NumReusedBlockOutputs 0 961 | Padding 0 962 | FrameData no 963 | TID 0 964 | SysNum 0 965 | } 966 | LocalBlockOutputDefaults { 967 | RecordType BlockOutput 968 | SigSrc [] 969 | GrSrc [-1, -1, -1, -1] 970 | IsSynthesized 0 971 | OwnerSysIdx [-1,-1] 972 | MemoryMapIdx [-1,-1,-1] 973 | HasObject 0 974 | TestPoint no 975 | ConstExpr 0 976 | OrigIdentifier "" 977 | StorageClass "Auto" 978 | Alignment -1 979 | CustomStorageClassVersion 0 980 | StorageTypeQualifier "" 981 | DrivesModelRefRootOutport no 982 | DrivesModelRefRootOutportNum -1 983 | DrivesRootOutport no 984 | IdentifierScope "top-level" 985 | Invariant no 986 | DeclareAsPointer no 987 | BitFieldWidth 0 988 | InitialValue [] 989 | InitInStart 0 990 | CGTypeIdx 0 991 | SigLabel "" 992 | SigConnected all 993 | NumReusedBlockOutputs 0 994 | Padding 0 995 | FrameData no 996 | TID 0 997 | SysNum 0 998 | DeclareInStartFcnScope 0 999 | DeclareInVirtualOutportStartFcnScope 0 1000 | DeclareInInitializeFcnScope 0 1001 | DeclareInOutputFcnScope 0 1002 | DeclareInUpdateFcnScope 0 1003 | DeclareInDerivativeFcnScope 0 1004 | DeclareInProjectionFcnScope 0 1005 | DeclareInForcingFunctionFcnScope 0 1006 | DeclareInMassMatrixFcnScope 0 1007 | DeclareInZeroCrossingFcnScope 0 1008 | DeclareInEnableFcnScope 0 1009 | DeclareInDisableFcnScope 0 1010 | DeclareInFinalizeDimsFcnScope 0 1011 | DeclareInSetDimsFcnScope 0 1012 | DeclareInTerminateFcnScope 0 1013 | VarGroupVarIdx -1 1014 | } 1015 | ExternalBlockOutputDefaults { 1016 | RecordType BlockOutput 1017 | SigSrc [] 1018 | GrSrc [-1, -1, -1, -1] 1019 | IsSynthesized 0 1020 | OwnerSysIdx [-1,-1] 1021 | MemoryMapIdx [-1,-1,-1] 1022 | HasObject 0 1023 | TestPoint no 1024 | ConstExpr 0 1025 | OrigIdentifier "" 1026 | StorageClass "Auto" 1027 | Alignment -1 1028 | CustomStorageClassVersion 0 1029 | StorageTypeQualifier "" 1030 | DrivesModelRefRootOutport no 1031 | DrivesModelRefRootOutportNum -1 1032 | DrivesRootOutport no 1033 | IdentifierScope "top-level" 1034 | Invariant no 1035 | DeclareAsPointer no 1036 | BitFieldWidth 0 1037 | InitialValue [] 1038 | InitInStart 0 1039 | CGTypeIdx 0 1040 | SigLabel "" 1041 | SigConnected all 1042 | NumReusedBlockOutputs 0 1043 | Padding 0 1044 | FrameData no 1045 | TID 0 1046 | SysNum 0 1047 | } 1048 | ConstBlockOutputDefaults { 1049 | RecordType BlockOutput 1050 | SigSrc [] 1051 | GrSrc [-1, -1, -1, -1] 1052 | IsSynthesized 0 1053 | OwnerSysIdx [-1,-1] 1054 | MemoryMapIdx [-1,-1,-1] 1055 | HasObject 0 1056 | TestPoint no 1057 | ConstExpr 0 1058 | OrigIdentifier "" 1059 | StorageClass "Auto" 1060 | Alignment -1 1061 | CustomStorageClassVersion 0 1062 | StorageTypeQualifier "" 1063 | DrivesModelRefRootOutport no 1064 | DrivesModelRefRootOutportNum -1 1065 | DrivesRootOutport no 1066 | IdentifierScope "top-level" 1067 | RequiredInConstBlockIO 0 1068 | DoNotConstify 0 1069 | Invariant yes 1070 | DeclareAsPointer no 1071 | BitFieldWidth 0 1072 | InitialValue [] 1073 | InitInStart 0 1074 | ConstantValueOutputChecksum [] 1075 | CGTypeIdx 0 1076 | SigLabel "" 1077 | SigConnected all 1078 | NumReusedBlockOutputs 0 1079 | Padding 0 1080 | FrameData no 1081 | TID constant 1082 | SysNum 0 1083 | } 1084 | ConstOutputExprDefaults { 1085 | RecordType BlockOutput 1086 | SigSrc [] 1087 | GrSrc [-1, -1, -1, -1] 1088 | IsSynthesized 0 1089 | OwnerSysIdx [-1,-1] 1090 | MemoryMapIdx [-1,-1,-1] 1091 | HasObject 0 1092 | TestPoint no 1093 | ConstExpr 0 1094 | OrigIdentifier "" 1095 | StorageClass "Auto" 1096 | Alignment -1 1097 | CustomStorageClassVersion 0 1098 | StorageTypeQualifier "" 1099 | DrivesModelRefRootOutport no 1100 | DrivesModelRefRootOutportNum -1 1101 | DrivesRootOutport no 1102 | IdentifierScope "top-level" 1103 | Invariant yes 1104 | DeclareAsPointer no 1105 | BitFieldWidth 0 1106 | InitialValue [] 1107 | InitInStart 0 1108 | CGTypeIdx 0 1109 | SigLabel "" 1110 | SigConnected all 1111 | NumReusedBlockOutputs 0 1112 | Padding 0 1113 | FrameData no 1114 | TID 0 1115 | SysNum 0 1116 | } 1117 | NumGlobalBlockOutputs 0 1118 | NumLocalBlockOutputs 1 1119 | NumExternalBlockOutputs 0 1120 | NumConstBlockOutputs 0 1121 | NumConstOutputExpr 2 1122 | LocalBlockOutput { 1123 | Identifier "rtb_t2fis" 1124 | SysCsIdx [0, -1] 1125 | LogicalSrc B0 1126 | SigDeclSysIdx 0 1127 | GrSrc [2, 0, 0, -1] 1128 | SigSrc [0, -1, 2, 0] 1129 | SigConnected none 1130 | } 1131 | ConstOutputExpr { 1132 | Identifier "Input1" 1133 | SysCsIdx [0, -1] 1134 | TID 1 1135 | LogicalSrc B1 1136 | ConstExpr 1 1137 | GrSrc [0, 1, 0, -1] 1138 | SigSrc [0, -1, 0, 0] 1139 | } 1140 | ConstOutputExpr { 1141 | Identifier "Input2" 1142 | SysCsIdx [0, -1] 1143 | TID 1 1144 | LogicalSrc B2 1145 | ConstExpr 1 1146 | GrSrc [0, 2, 0, -1] 1147 | SigSrc [0, -1, 1, 0] 1148 | } 1149 | } 1150 | DWorks { 1151 | DWorkDefaults { 1152 | RecordType DWork 1153 | MemoryMapIdx [-1,-1,-1] 1154 | OrigIdentifier "" 1155 | LogStateName "" 1156 | StorageClass "Auto" 1157 | Alignment -1 1158 | CustomStorageClassVersion 0 1159 | StorageTypeQualifier "" 1160 | OptimizedAwayInTLC 0 1161 | GlobalDSM 0 1162 | IsLocalScratchDWork 0 1163 | DeclareInStartFcnScope 0 1164 | DeclareInVirtualOutportStartFcnScope 0 1165 | DeclareInInitializeFcnScope 0 1166 | DeclareInOutputFcnScope 0 1167 | DeclareInUpdateFcnScope 0 1168 | DeclareInDerivativeFcnScope 0 1169 | DeclareInProjectionFcnScope 0 1170 | DeclareInForcingFunctionFcnScope 0 1171 | DeclareInMassMatrixFcnScope 0 1172 | DeclareInZeroCrossingFcnScope 0 1173 | DeclareInEnableFcnScope 0 1174 | DeclareInDisableFcnScope 0 1175 | DeclareInFinalizeDimsFcnScope 0 1176 | DeclareInSetDimsFcnScope 0 1177 | DeclareInTerminateFcnScope 0 1178 | VarGroupVarIdx -1 1179 | HasObject 0 1180 | CGTypeIdx 0 1181 | DeclareAsPointer no 1182 | Origin "DWORK" 1183 | UsedAs "DWORK" 1184 | DataLoggingOn "0" 1185 | InitialValue [] 1186 | Padding 0 1187 | BitFieldWidth 0 1188 | GrSrc [-1, -1] 1189 | SFcnWrapperMode "none" 1190 | SFcnWrapperDSMName "" 1191 | TID 0 1192 | MdlRefBlkOutputDimSize 0 1193 | DWorkForDimSize 0 1194 | DrivesModelRefRootOutportSize 0 1195 | ModelRefRootInportSize 0 1196 | ForEachNumberOfIters 0 1197 | InitInStart 0 1198 | } 1199 | NumDWorks 0 1200 | NumNonLocalDWorks 0 1201 | NumSFcnWrapperDWorks 0 1202 | } 1203 | SubsystemRanBC { 1204 | SysRanDWork [-1] 1205 | ContextSysIdx [0] 1206 | } 1207 | ContStates { 1208 | NumContStates 0 1209 | } 1210 | MassMatrices { 1211 | NumMassMatrices 0 1212 | } 1213 | ZcRec { 1214 | NumBlkZcRecs 0 1215 | } 1216 | ExprCommentInfoDefaults { 1217 | SysIdxList [] 1218 | BlkIdxList [] 1219 | PortIdxList [] 1220 | } 1221 | ExprCommentSrcIdxDefaults { 1222 | SysIdx -1 1223 | BlkIdx -1 1224 | PortIdx -1 1225 | } 1226 | BlockDefaults { 1227 | UserDefinedRWork 0 1228 | UserDefinedIWork 0 1229 | UserDefinedPWork 0 1230 | NumRWorkDefines -1 1231 | NumIWorkDefines -1 1232 | NumPWorkDefines -1 1233 | RecordType Block 1234 | InMask no 1235 | UseTLC 0 1236 | DeletedInIR 0 1237 | AlgebraicLoopId 0 1238 | PortBasedSampleTimes no 1239 | ContStates [0,0,0] 1240 | ModeVector [0,-1] 1241 | RWork [0,-1] 1242 | IWork [0,-1] 1243 | PWork [0,-1] 1244 | DiscStates [0,-1] 1245 | MassMatrixPr [0,-1] 1246 | NumDWork 0 1247 | NumNonsampledZCs 0 1248 | ZCEvents [0,0] 1249 | NumBlkZcRecs 0 1250 | RollRegions [] 1251 | NumDataInputPorts 0 1252 | NumControlInputPorts 0 1253 | NumDataOutputPorts 1 1254 | Parameters [0,0] 1255 | NumParameterGroups 0 1256 | Description [] 1257 | PolySpaceStartComment [] 1258 | PolySpaceEndComment [] 1259 | ReducedBlocksConnected [] 1260 | TLCExprCompliant 0 1261 | CustomStorageClassCompliant 1 1262 | EnforceIntegerDowncast 1 1263 | HaveBlockComment 0 1264 | InFixptMode 0 1265 | GrSrc [-1, -1] 1266 | NeedOutputsFcnInMdlStart 0 1267 | AsyncSfcn 0 1268 | TriggeredBlockConstantSampleTimePorts [] 1269 | } 1270 | OutportParamSettingsDefaults { 1271 | VirtualizableRoot no 1272 | BusObject "" 1273 | OutputAsStructure 0 1274 | InputContiguous yes 1275 | SpecifyIC no 1276 | } 1277 | SubsystemParamSettingsDefaults { 1278 | EnableOutputScope no 1279 | SystemContStates [0, 0] 1280 | NumNonsampledZCs 0 1281 | BlkZcRecOffset 0 1282 | SingleRate yes 1283 | MinorStepGuard no 1284 | } 1285 | ASTNodeDefaults { 1286 | IsNonTerminal 0 1287 | } 1288 | ParameterDefaults { 1289 | RecordType BlockParameter 1290 | MdlPrmIdx -1 1291 | ArgDefIdx -1 1292 | MemoryMapIdx [-1,-1,-1] 1293 | OriginalDataTypeIdx 0 1294 | CGTypeIdx 18 1295 | Tunable on 1296 | OrigIdentifier "" 1297 | StorageClass Auto 1298 | NeedParenthesis 0 1299 | StringTransformed "" 1300 | Value [0.0] 1301 | } 1302 | DataInputPortDefaults { 1303 | RecordType DataInputPort 1304 | SignalSrc [] 1305 | SignalOffset [0] 1306 | SignalRegion [0] 1307 | CGTypeIdx 0 1308 | SystemToCall [-1, -1] 1309 | FrameData no 1310 | RecurseOnInput 0 1311 | HaveGround no 1312 | BufferDstPort -1 1313 | AllowScalarExpandedExpr 0 1314 | } 1315 | HiddenDataInputPortDefaults { 1316 | RecordType DataInputPort 1317 | SignalSrc [] 1318 | SignalOffset [0] 1319 | SignalRegion [0] 1320 | CGTypeIdx 0 1321 | SystemToCall [-1, -1] 1322 | FrameData no 1323 | RecurseOnInput 0 1324 | HaveGround no 1325 | BufferDstPort -1 1326 | AllowScalarExpandedExpr 0 1327 | } 1328 | ControlInputPortDefaults { 1329 | RecordType ControlInputPort 1330 | SignalSrc [] 1331 | SignalOffset [0] 1332 | SignalRegion [0] 1333 | CGTypeIdx 0 1334 | FrameData no 1335 | RecurseOnInput 0 1336 | HaveGround no 1337 | BufferDstPort -1 1338 | } 1339 | HiddenControlInputPortDefaults { 1340 | RecordType ControlInputPort 1341 | SignalSrc [] 1342 | SignalOffset [0] 1343 | SignalRegion [0] 1344 | CGTypeIdx 0 1345 | FrameData no 1346 | RecurseOnInput 0 1347 | HaveGround no 1348 | BufferDstPort -1 1349 | } 1350 | DataOutputPortDefaults { 1351 | RecordType DataOutputPort 1352 | SignalSrc [] 1353 | SignalOffset [0] 1354 | CGTypeIdx 0 1355 | OutputExpression 0 1356 | TrivialOutputExpression 0 1357 | FrameData no 1358 | SystemToCall [-1, -1] 1359 | } 1360 | OpaqueBlockMethodeDefaults { 1361 | HasInstanceSetup 0 1362 | HasStart 0 1363 | HasVirtualOutportStart 0 1364 | HasInitializeConditions 0 1365 | HasOutputs 0 1366 | HasUpdate 0 1367 | HasDerivatives 0 1368 | HasProjection 0 1369 | HasForcingFunction 0 1370 | HasMassMatrix 0 1371 | HasZeroCrossings 0 1372 | HasEnable 0 1373 | HasDisable 0 1374 | HasFinalizeDims 0 1375 | HasSetDims 0 1376 | HasTerminate 0 1377 | HasDeadCode 0 1378 | HasConstCode 0 1379 | } 1380 | CanonicalInputArgDefaults { 1381 | SignalSrc [] 1382 | SignalOffset [0] 1383 | CGTypeIdx 0 1384 | SrcIsPointerToArray no 1385 | DeclareAsPointer no 1386 | } 1387 | CanonicalInputArgDefDefaults { 1388 | Identifier "" 1389 | SignalSrc [] 1390 | SignalOffset [0] 1391 | CGTypeIdx 0 1392 | StorageClass Auto 1393 | DeclareAsPointer no 1394 | } 1395 | CanonicalOutputArgDefaults { 1396 | SignalSrc [] 1397 | SignalOffset [0] 1398 | CGTypeIdx 0 1399 | } 1400 | CanonicalOutputArgDefDefaults { 1401 | Identifier "" 1402 | SignalSrc [] 1403 | SignalOffset [0] 1404 | CGTypeIdx 0 1405 | StorageClass Auto 1406 | PassByReturn no 1407 | DeclareAsPointer yes 1408 | } 1409 | CanonicalDWorkArgDefaults { 1410 | SignalSrc [] 1411 | } 1412 | CanonicalDWorkArgDefDefaults { 1413 | FirstSignalSrc [] 1414 | IsCanonicalDimSizeDWork 0 1415 | DeclareAsPointer yes 1416 | Alignment -1 1417 | } 1418 | ModelParameters { 1419 | NumParameters 2 1420 | NumInrtP 2 1421 | NumConstPrmsWithInit 0 1422 | NumConstPrms 0 1423 | NumExportedGlobal 0 1424 | NumImportedExtern 0 1425 | NumImportedExternPointer 0 1426 | NumCustomStorageClass 0 1427 | NumInMdlRefGlobal 0 1428 | StructAlignment 0 1429 | GlobalParamsList [] 1430 | GlobalParamsChecksum "3649838548,78774415,2550759657,2118318316" 1431 | ParameterDefaults { 1432 | RecordType ModelParameter 1433 | MemoryMapIdx [-1,-1,-1] 1434 | HasObject 0 1435 | OriginalDataTypeIdx 0 1436 | CGTypeIdx 18 1437 | WorkspaceVarName "" 1438 | Tunable yes 1439 | RollVarDeclared 0 1440 | Transformed no 1441 | OrigIdentifier "" 1442 | StorageClass "Auto" 1443 | CustomStorageClassVersion 0 1444 | TypeQualifier "" 1445 | DefinedInLegacyCode 0 1446 | LegacyDimensions 0 1447 | LegacySymbolName "" 1448 | IsSfcnSizePrm 0 1449 | IsImportedMacroUsedInVariantCondExpr 0 1450 | Value [0.0] 1451 | Padding 0 1452 | Alignment -1 1453 | InConstSection 0 1454 | InConstWithInitSection 0 1455 | InModelRefGlobalSection 0 1456 | WasAccessedAsVariable 0 1457 | } 1458 | Parameter { 1459 | Identifier "Input1_Value" 1460 | LogicalSrc P0 1461 | Value [1.0] 1462 | ContainerCGTypeIdx 20 1463 | ReferencedBy Matrix(1,4) 1464 | [[0, -1, 0, 0];] 1465 | GraphicalRef Matrix(1,2) 1466 | [[0, 1];] 1467 | OwnerSysIdx [0, -1] 1468 | WasAccessedAsVariable 1 1469 | } 1470 | Parameter { 1471 | Identifier "Input2_Value" 1472 | LogicalSrc P1 1473 | Value [1.0] 1474 | ContainerCGTypeIdx 20 1475 | ReferencedBy Matrix(1,4) 1476 | [[0, -1, 1, 0];] 1477 | GraphicalRef Matrix(1,2) 1478 | [[0, 2];] 1479 | OwnerSysIdx [0, -1] 1480 | WasAccessedAsVariable 1 1481 | } 1482 | } 1483 | InsertedHiddenBlocks { 1484 | NumInsertedHiddenBlocks 0 1485 | } 1486 | CustomStorageClasses { 1487 | NumCustomStorageClasses 0 1488 | } 1489 | DataObjectUsage { 1490 | NumFiles [6] 1491 | File { 1492 | Name "Type2FuzzyLogicSystems" 1493 | Type "source" 1494 | IsCustom "no" 1495 | } 1496 | File { 1497 | Name "Type2FuzzyLogicSystems" 1498 | Type "header" 1499 | IsCustom "no" 1500 | } 1501 | File { 1502 | Name "Type2FuzzyLogicSystems_data" 1503 | Type "source" 1504 | IsCustom "no" 1505 | } 1506 | File { 1507 | Name "Type2FuzzyLogicSystems_types" 1508 | Type "header" 1509 | IsCustom "no" 1510 | } 1511 | File { 1512 | Name "Type2FuzzyLogicSystems_private" 1513 | Type "header" 1514 | IsCustom "no" 1515 | } 1516 | File { 1517 | Name "Type2FuzzyLogicSystems_sf" 1518 | Type "header" 1519 | IsCustom "no" 1520 | } 1521 | NumDataObjects [0] 1522 | NumSignalObjects [0] 1523 | FirstSignalObjectIdx [0] 1524 | NumParameterObjects [0] 1525 | FirstParameterObjectIdx [0] 1526 | NumStateObjects [0] 1527 | FirstStateObjectIdx [0] 1528 | DataObjectSymbols { 1529 | } 1530 | UsageCheckError { 1531 | } 1532 | } 1533 | NumSubsystems 2 1534 | Subsystem { 1535 | Name "/Fuzzy Type-2 Controller" 1536 | } 1537 | Subsystem { 1538 | Name "/t2fis" 1539 | } 1540 | ModelSupportsMultipleExecInstances 1 1541 | ModelHasStateInsideForEachSS 0 1542 | InterfaceDefaults { 1543 | NumCanonicalPrmArgDefs 0 1544 | NumCanonicalDWorkArgDefs 0 1545 | } 1546 | InstanceCacheDefaults { 1547 | StartHeader "" 1548 | VirtualOutportStartHeader "" 1549 | InitializeHeader "" 1550 | OutputHeader "" 1551 | UpdateHeader "" 1552 | DerivativeHeader "" 1553 | ProjectionHeader "" 1554 | ForcingFunctionHeader "" 1555 | MassMatrixHeader "" 1556 | ZeroCrossingHeader "" 1557 | EnableHeader "" 1558 | DisableHeader "" 1559 | FinalizeDimsHeader "" 1560 | SetDimsHeader "" 1561 | TerminateHeader "" 1562 | OutputUpdateHeader "" 1563 | StartBody "" 1564 | VirtualOutportStartBody "" 1565 | InitializeBody "" 1566 | OutputBody "" 1567 | UpdateBody "" 1568 | DerivativeBody "" 1569 | ProjectionBody "" 1570 | ForcingFunctionBody "" 1571 | MassMatrixBody "" 1572 | ZeroCrossingBody "" 1573 | EnableBody "" 1574 | DisableBody "" 1575 | FinalizeDimsBody "" 1576 | SetDimsBody "" 1577 | TerminateBody "" 1578 | OutputUpdateBody "" 1579 | StartTrailer "" 1580 | VirtualOutportStartTrailer "" 1581 | InitializeTrailer "" 1582 | OutputTrailer "" 1583 | UpdateTrailer "" 1584 | DerivativeTrailer "" 1585 | ProjectionTrailer "" 1586 | ForcingFunctionTrailer "" 1587 | MassMatrixTrailer "" 1588 | ZeroCrossingTrailer "" 1589 | EnableTrailer "" 1590 | DisableTrailer "" 1591 | FinalizeDimsTrailer "" 1592 | SetDimsTrailer "" 1593 | TerminateTrailer "" 1594 | OutputUpdateTrailer "" 1595 | StartCacheAssert 0 1596 | VirtualOutportStartCacheAssert 0 1597 | InitializeCacheAssert 0 1598 | OutputCacheAssert 0 1599 | UpdateCacheAssert 0 1600 | DerivativeCacheAssert 0 1601 | ProjectionCacheAssert 0 1602 | ForcingFunctionCacheAssert 0 1603 | MassMatrixCacheAssert 0 1604 | ZeroCrossingCacheAssert 0 1605 | EnableCacheAssert 0 1606 | DisableCacheAssert 0 1607 | FinalizeDimsCacheAssert 0 1608 | SetDimsCacheAssert 0 1609 | TerminateCacheAssert 0 1610 | OutputUpdateCacheAssert 0 1611 | CachedStartFcn "" 1612 | CachedVirtualOutportStartFcn "" 1613 | CachedInitializeFcn "" 1614 | CachedOutputFcn "" 1615 | CachedUpdateFcn "" 1616 | CachedDerivativeFcn "" 1617 | CachedProjectionFcn "" 1618 | CachedForcingFunctionFcn "" 1619 | CachedMassMatrixFcn "" 1620 | CachedZeroCrossingFcn "" 1621 | CachedEnableFcn "" 1622 | CachedDisableFcn "" 1623 | CachedFinalizeDimsFcn "" 1624 | CachedSetDimsFcn "" 1625 | CachedTerminateFcn "" 1626 | CachedOutputUpdateFcn "" 1627 | CachedStartSSVars "" 1628 | CachedVirtualOutportStartSSVars "" 1629 | CachedInitializeSSVars "" 1630 | CachedOutputSSVars "" 1631 | CachedUpdateSSVars "" 1632 | CachedDerivativeSSVars "" 1633 | CachedProjectionSSVars "" 1634 | CachedForcingFunctionSSVars "" 1635 | CachedMassMatrixSSVars "" 1636 | CachedZeroCrossingSSVars "" 1637 | CachedEnableSSVars "" 1638 | CachedDisableSSVars "" 1639 | CachedFinalizeDimsSSVars "" 1640 | CachedSetDimsSSVars "" 1641 | CachedTerminateSSVars "" 1642 | CachedOutputUpdateSSVars "" 1643 | CachedStartGlobalVars "" 1644 | CachedVirtualOutportStartGlobalVars "" 1645 | CachedInitializeGlobalVars "" 1646 | CachedOutputGlobalVars "" 1647 | CachedUpdateGlobalVars "" 1648 | CachedDerivativeGlobalVars "" 1649 | CachedProjectionGlobalVars "" 1650 | CachedForcingFunctionGlobalVars "" 1651 | CachedMassMatrixGlobalVars "" 1652 | CachedZeroCrossingGlobalVars "" 1653 | CachedEnableGlobalVars "" 1654 | CachedDisableGlobalVars "" 1655 | CachedFinalizeDimsGlobalVars "" 1656 | CachedSetDimsGlobalVars "" 1657 | CachedTerminateGlobalVars "" 1658 | CachedOutputUpdateGlobalVars "" 1659 | CachedStartLocalBO "" 1660 | CachedVirtualOutportStartLocalBO "" 1661 | CachedInitializeLocalBO "" 1662 | CachedOutputLocalBO "" 1663 | CachedUpdateLocalBO "" 1664 | CachedDerivativeLocalBO "" 1665 | CachedProjectionLocalBO "" 1666 | CachedForcingFunctionLocalBO "" 1667 | CachedMassMatrixLocalBO "" 1668 | CachedZeroCrossingLocalBO "" 1669 | CachedEnableLocalBO "" 1670 | CachedDisableLocalBO "" 1671 | CachedFinalizeDimsLocalBO "" 1672 | CachedSetDimsLocalBO "" 1673 | CachedTerminateLocalBO "" 1674 | CachedOutputUpdateLocalBO "" 1675 | CachedStartLocalVars "" 1676 | CachedVirtualOutportStartLocalVars "" 1677 | CachedInitializeLocalVars "" 1678 | CachedOutputLocalVars "" 1679 | CachedUpdateLocalVars "" 1680 | CachedDerivativeLocalVars "" 1681 | CachedProjectionLocalVars "" 1682 | CachedForcingFunctionLocalVars "" 1683 | CachedMassMatrixLocalVars "" 1684 | CachedZeroCrossingLocalVars "" 1685 | CachedEnableLocalVars "" 1686 | CachedDisableLocalVars "" 1687 | CachedFinalizeDimsLocalVars "" 1688 | CachedSetDimsLocalVars "" 1689 | CachedTerminateLocalVars "" 1690 | CachedOutputUpdateLocalVars "" 1691 | CachedStartProfileDeclsCode "" 1692 | CachedVirtualOutportStartProfileDeclsCode "" 1693 | CachedInitializeProfileDeclsCode "" 1694 | CachedOutputProfileDeclsCode "" 1695 | CachedUpdateProfileDeclsCode "" 1696 | CachedDerivativeProfileDeclsCode "" 1697 | CachedProjectionProfileDeclsCode "" 1698 | CachedForcingFunctionProfileDeclsCode "" 1699 | CachedMassMatrixProfileDeclsCode "" 1700 | CachedZeroCrossingProfileDeclsCode "" 1701 | CachedEnableProfileDeclsCode "" 1702 | CachedDisableProfileDeclsCode "" 1703 | CachedFinalizeDimsProfileDeclsCode "" 1704 | CachedSetDimsProfileDeclsCode "" 1705 | CachedTerminateProfileDeclsCode "" 1706 | CachedOutputUpdateProfileDeclsCode "" 1707 | CachedStartProfileStartCode "" 1708 | CachedVirtualOutportStartProfileStartCode "" 1709 | CachedInitializeProfileStartCode "" 1710 | CachedOutputProfileStartCode "" 1711 | CachedUpdateProfileStartCode "" 1712 | CachedDerivativeProfileStartCode "" 1713 | CachedProjectionProfileStartCode "" 1714 | CachedForcingFunctionProfileStartCode "" 1715 | CachedMassMatrixProfileStartCode "" 1716 | CachedZeroCrossingProfileStartCode "" 1717 | CachedEnableProfileStartCode "" 1718 | CachedDisableProfileStartCode "" 1719 | CachedFinalizeDimsProfileStartCode "" 1720 | CachedSetDimsProfileStartCode "" 1721 | CachedTerminateProfileStartCode "" 1722 | CachedOutputUpdateProfileStartCode "" 1723 | CachedStartProfileEndCode "" 1724 | CachedVirtualOutportStartProfileEndCode "" 1725 | CachedInitializeProfileEndCode "" 1726 | CachedOutputProfileEndCode "" 1727 | CachedUpdateProfileEndCode "" 1728 | CachedDerivativeProfileEndCode "" 1729 | CachedProjectionProfileEndCode "" 1730 | CachedForcingFunctionProfileEndCode "" 1731 | CachedMassMatrixProfileEndCode "" 1732 | CachedZeroCrossingProfileEndCode "" 1733 | CachedEnableProfileEndCode "" 1734 | CachedDisableProfileEndCode "" 1735 | CachedFinalizeDimsProfileEndCode "" 1736 | CachedSetDimsProfileEndCode "" 1737 | CachedTerminateProfileEndCode "" 1738 | CachedOutputUpdateProfileEndCode "" 1739 | Output0Fcn "" 1740 | Update0Fcn "" 1741 | OutputUpdate0Fcn "" 1742 | Output1Fcn "" 1743 | Update1Fcn "" 1744 | OutputUpdate1Fcn "" 1745 | CachedConstCodeLocalVars "" 1746 | CachedSubFunctions "" 1747 | CachedStateflowFcnCode "" 1748 | SystemIncludes "" 1749 | SharedTypeIncludes "" 1750 | SystemSharedDataIncludes "" 1751 | SharedConstantsExterns "" 1752 | SystemTypeDefs "" 1753 | SystemFcnPrototype "" 1754 | SystemMemberPrototype "" 1755 | EncapSystemFcnPrototype "" 1756 | NeedTIDInOutput 0 1757 | NeedTIDInUpdate 0 1758 | NeedCPIInOutputUpdate 0 1759 | ForceOutputUpdateFcn 0 1760 | InstanceCached 0 1761 | InstanceTerminateCached 0 1762 | InstanceDumped 0 1763 | InstanceHeaderDumped 0 1764 | InstanceNonEmpty 0 1765 | InstanceTerminateNonEmpty 0 1766 | NeedMathLibrary 0 1767 | SystemCached 0 1768 | SystemNonEmpty 0 1769 | SystemTerminateCached 0 1770 | SystemTerminateNonEmpty 0 1771 | SystemDumped 0 1772 | } 1773 | BlockIOArgDefDefaults { 1774 | FirstLocation 0 1775 | NumFlatFields 0 1776 | } 1777 | ConstBlockIOArgDefDefaults { 1778 | FirstLocation 0 1779 | NumFlatFields 0 1780 | } 1781 | DWorkArgDefDefaults { 1782 | FirstLocation 0 1783 | NumFlatFields 0 1784 | } 1785 | LocalSDWorkArgDefDefaults { 1786 | FirstLocation 0 1787 | NumFlatFields 0 1788 | } 1789 | ContStatesArgDefDefaults { 1790 | FirstLocation 0 1791 | NumFlatFields 0 1792 | } 1793 | NonsampledZCArgDefDefaults { 1794 | FirstLocation 0 1795 | NumFlatFields 0 1796 | } 1797 | ZCEventArgDefDefaults { 1798 | FirstLocation 0 1799 | NumFlatFields 0 1800 | } 1801 | ZCSVArgDefDefaults { 1802 | FirstLocation 0 1803 | NumFlatFields 0 1804 | } 1805 | LocalBlockIODefDefaults { 1806 | FirstLocation 0 1807 | NumFlatFields 0 1808 | } 1809 | ExternBlockIODefDefaults { 1810 | FirstLocation 0 1811 | NumFlatFields 0 1812 | } 1813 | SystemDefaults { 1814 | HasDWorkArg 0 1815 | HasBlockIOArg 0 1816 | HasConstBlockIOArg 0 1817 | HasParametersArg 0 1818 | HasZCEventArg 0 1819 | HasCStatesArg 0 1820 | HasCStatesDerivArg 0 1821 | HasContStatesDisabledArg 0 1822 | HasContStatesAbsoluteToleranceArg 0 1823 | HasMassMatrixGlobalArg 0 1824 | HasNonSampledZCArg 0 1825 | HasZCSignalValueArg 0 1826 | DeletedInIR 0 1827 | IsCondExec 0 1828 | StandaloneSubsystem 0 1829 | LivesInStandaloneSS [0] 1830 | StandaloneParentSysIdx [-1] 1831 | ForEachSubsystem 0 1832 | NumImplicitIter 1 1833 | HasBlockRunInSimulinkForAccel 0 1834 | HasRTWUserData 0 1835 | StartMethodHasUserData 0 1836 | VirtualOutportStartMethodHasUserData 0 1837 | InitializeMethodHasUserData 0 1838 | OutputMethodHasUserData 0 1839 | UpdateMethodHasUserData 0 1840 | DerivativeMethodHasUserData 0 1841 | ProjectionMethodHasUserData 0 1842 | ForcingFunctionMethodHasUserData 0 1843 | MassMatrixMethodHasUserData 0 1844 | ZeroCrossingMethodHasUserData 0 1845 | EnableMethodHasUserData 0 1846 | DisableMethodHasUserData 0 1847 | FinalizeDimsMethodHasUserData 0 1848 | SetDimsMethodHasUserData 0 1849 | TerminateMethodHasUserData 0 1850 | OutputUpdateMethodHasUserData 0 1851 | StartUserDataTLCInserted 0 1852 | VirtualOutportStartUserDataTLCInserted 0 1853 | InitializeUserDataTLCInserted 0 1854 | OutputUserDataTLCInserted 0 1855 | UpdateUserDataTLCInserted 0 1856 | DerivativeUserDataTLCInserted 0 1857 | ProjectionUserDataTLCInserted 0 1858 | ForcingFunctionUserDataTLCInserted 0 1859 | MassMatrixUserDataTLCInserted 0 1860 | ZeroCrossingUserDataTLCInserted 0 1861 | EnableUserDataTLCInserted 0 1862 | DisableUserDataTLCInserted 0 1863 | FinalizeDimsUserDataTLCInserted 0 1864 | SetDimsUserDataTLCInserted 0 1865 | TerminateUserDataTLCInserted 0 1866 | OutputUpdateUserDataTLCInserted 0 1867 | NetPreprocessorCondition "" 1868 | NetPreprocessorInstanceConditions "" 1869 | CurrentTID -1 1870 | GeneratingSubFunctions 0 1871 | ArgumentReplacements [] 1872 | } 1873 | CanonicalPrmArgDefDefaults { 1874 | OriginalDataTypeIdx 0 1875 | CGTypeIdx 18 1876 | IsUsed yes 1877 | DeclareAsPointer no 1878 | } 1879 | NumSystems 1 1880 | System { 1881 | Type root 1882 | Name "" 1883 | Identifier "Type2FuzzyLogicSystems" 1884 | RTWSystemCode 2 1885 | Synthesized 0 1886 | CrossNoArgFcnBound 0 1887 | ContainsNonreusedFcn 0 1888 | ForceNonInline 0 1889 | SystemIdx 0 1890 | SL_SystemIdx 0 1891 | ParameterVarGroupIndex [0] 1892 | HStructDeclSystemIdx 0 1893 | ReusedParentSystemIdx 0 1894 | NonInlinedParentSystemIdx 0 1895 | NumHStructChildSystems 0 1896 | NumChildSystems 0 1897 | Interface { 1898 | NumCanonicalInputArgDefs 0 1899 | BlockIOArgDef { 1900 | } 1901 | ConstBlockIOArgDef { 1902 | } 1903 | NumCanonicalOutputArgDefs 0 1904 | ParameterArgDef { 1905 | FirstLocation 0 1906 | NumFlatFields 2 1907 | PassthroughSystemIdx -1 1908 | } 1909 | DWorkArgDef { 1910 | } 1911 | LocalSDWorkArgDef { 1912 | } 1913 | ContStatesArgDef { 1914 | } 1915 | ContStatesDerivativeArgDef { 1916 | } 1917 | ContStatesDisabledArgDef { 1918 | } 1919 | ContStatesAbsoluteToleranceArgDef { 1920 | } 1921 | NonsampledZCArgDef { 1922 | } 1923 | ZCEventArgDef { 1924 | } 1925 | ZCSVArgDef { 1926 | } 1927 | RTMArgDef { 1928 | } 1929 | } 1930 | Variables { 1931 | LocalBlockIODef { 1932 | NumFlatFields 1 1933 | } 1934 | ExternBlockIODef { 1935 | } 1936 | } 1937 | RunFcnCallSSInMinorStep no 1938 | TriggerBlkIdx -1 1939 | TriggerBlkReset 0 1940 | StatesCanReset no 1941 | GuardAgainstStateReset no 1942 | NumZCEvents 0 1943 | CGIRModuleIdx 0 1944 | FileNameOwnerIdx 0 1945 | IncludedChildSystemIdx [] 1946 | IncludedReusableParentSystemIdx [] 1947 | IncludedReusableParentHeaderFiles [] 1948 | NumIncludedModelReference 0 1949 | SystemFileName "Type2FuzzyLogicSystems" 1950 | NumBlocks 4 1951 | NumVirtualOutportBlocks 0 1952 | VirtualOutportBlocksIdx 4 1953 | NumTotalBlocks 4 1954 | Block { 1955 | Type Constant 1956 | BlockIdx [0, 0, 0] 1957 | SL_BlockIdx 0 1958 | GrSrc [0, 1] 1959 | ExprCommentInfo { 1960 | } 1961 | ExprCommentSrcIdx { 1962 | } 1963 | Name "/Input 1" 1964 | Identifier "Input1" 1965 | TID 1 1966 | RollRegions [0] 1967 | DataOutputPort { 1968 | SignalSrc [C0] 1969 | OutputExpression 1 1970 | TrivialOutputExpression 1 1971 | } 1972 | Parameters [1, 1] 1973 | Parameter { 1974 | Name "Value" 1975 | ASTNode { 1976 | IsNonTerminal 0 1977 | Op SL_NOT_INLINED 1978 | ModelParameterIdx 0 1979 | } 1980 | Value [1.0] 1981 | ContainerCGTypeIdx 20 1982 | String "1" 1983 | StringType "Expression" 1984 | } 1985 | Value Parameter[0] 1986 | } 1987 | Block { 1988 | Type Constant 1989 | BlockIdx [0, 0, 1] 1990 | SL_BlockIdx 1 1991 | GrSrc [0, 2] 1992 | ExprCommentInfo { 1993 | } 1994 | ExprCommentSrcIdx { 1995 | } 1996 | Name "/Input 2" 1997 | Identifier "Input2" 1998 | TID 1 1999 | RollRegions [0] 2000 | DataOutputPort { 2001 | SignalSrc [C1] 2002 | OutputExpression 1 2003 | TrivialOutputExpression 1 2004 | } 2005 | Parameters [1, 1] 2006 | Parameter { 2007 | Name "Value" 2008 | ASTNode { 2009 | IsNonTerminal 0 2010 | Op SL_NOT_INLINED 2011 | ModelParameterIdx 1 2012 | } 2013 | Value [1.0] 2014 | ContainerCGTypeIdx 20 2015 | String "1" 2016 | StringType "Expression" 2017 | } 2018 | Value Parameter[0] 2019 | } 2020 | Block { 2021 | Type MATLABFcn 2022 | InMask yes 2023 | UseTLC 1 2024 | BlockIdx [0, 0, 2] 2025 | SL_BlockIdx 2 2026 | GrSrc [2, 0] 2027 | ExprCommentInfo { 2028 | } 2029 | ExprCommentSrcIdx { 2030 | } 2031 | Name "/t2fis" 2032 | Identifier "t2fis" 2033 | TID 0 2034 | RollRegions [0, 1] 2035 | NumDataInputPorts 1 2036 | DataInputPort { 2037 | SignalSrc [C0, C1] 2038 | SignalOffset [0, 0] 2039 | SignalRegion [0@1 ,1@1] 2040 | CGTypeIdx 17 2041 | } 2042 | DataOutputPort { 2043 | SignalSrc [L0] 2044 | } 2045 | } 2046 | Block { 2047 | Type Opaque 2048 | BlockIdx [0, 0, 3] 2049 | SL_BlockIdx 3 2050 | ExprCommentInfo { 2051 | } 2052 | ExprCommentSrcIdx { 2053 | } 2054 | Name "/Opaque" 2055 | Identifier "Input1" 2056 | TID [0, 1] 2057 | NumDataOutputPorts 0 2058 | TLCFileName "s0_b0_5egds" 2059 | OpaqueBlockMethode { 2060 | HasInitializeConditions 1 2061 | HasOutputs 1 2062 | } 2063 | Parameters [2, 2] 2064 | Parameter { 2065 | Name "Value" 2066 | MdlPrmIdx 0 2067 | Value [1.0] 2068 | ContainerCGTypeIdx 20 2069 | String "1" 2070 | StringType "Expression" 2071 | } 2072 | Parameter { 2073 | Name "Value" 2074 | MdlPrmIdx 1 2075 | Value [1.0] 2076 | ContainerCGTypeIdx 20 2077 | String "1" 2078 | StringType "Expression" 2079 | } 2080 | } 2081 | EmptySubsysInfo { 2082 | NumRTWdatas 0 2083 | } 2084 | } 2085 | BlockParamChecksum ["1624200848U", "2739599552U", "673613188U", "1829379759U"] 2086 | ModelChecksum ["3100205893U", "1333815299U", "2046953505U", "2012626803U"] 2087 | IncludeCodeGenSettings 1 2088 | CGTypes { 2089 | CGTypeDefaults { 2090 | SLTypeIdx -1 2091 | BaseIdx 0 2092 | Width 1 2093 | NumDimensions 2 2094 | Dimensions [1, 1] 2095 | IsLoweredMultiWord 0 2096 | StructAlignment -1 2097 | } 2098 | MemberDefaults { 2099 | CGTypeIdx 0 2100 | Alignment -1 2101 | } 2102 | NumCGTypes 21 2103 | DeclareUsedMultiWordBits 0 2104 | CGType { 2105 | Name "real_T" 2106 | SLTypeIdx 0 2107 | Constructor "double" 2108 | } 2109 | CGType { 2110 | Name "real32_T" 2111 | SLTypeIdx 1 2112 | Constructor "float" 2113 | } 2114 | CGType { 2115 | Name "int8_T" 2116 | SLTypeIdx 2 2117 | Constructor "signed" 2118 | } 2119 | CGType { 2120 | Name "uint8_T" 2121 | SLTypeIdx 3 2122 | Constructor "unsigned" 2123 | } 2124 | CGType { 2125 | Name "int16_T" 2126 | SLTypeIdx 4 2127 | Constructor "signed" 2128 | } 2129 | CGType { 2130 | Name "uint16_T" 2131 | SLTypeIdx 5 2132 | Constructor "unsigned" 2133 | } 2134 | CGType { 2135 | Name "int32_T" 2136 | SLTypeIdx 6 2137 | Constructor "signed" 2138 | } 2139 | CGType { 2140 | Name "uint32_T" 2141 | SLTypeIdx 7 2142 | Constructor "unsigned" 2143 | } 2144 | CGType { 2145 | Name "boolean_T" 2146 | SLTypeIdx 8 2147 | Constructor "bool" 2148 | } 2149 | CGType { 2150 | Name "fcn_call" 2151 | SLTypeIdx 9 2152 | Constructor "unknown" 2153 | } 2154 | CGType { 2155 | Name "int_T" 2156 | SLTypeIdx 10 2157 | Constructor "renamed" 2158 | BaseIdx 6 2159 | } 2160 | CGType { 2161 | SLTypeIdx 11 2162 | Constructor "pointer" 2163 | BaseIdx 14 2164 | } 2165 | CGType { 2166 | Name "action" 2167 | SLTypeIdx 12 2168 | Constructor "unknown" 2169 | } 2170 | CGType { 2171 | Name "timer_uint32_pair" 2172 | SLTypeIdx 13 2173 | Width 2 2174 | Constructor "array" 2175 | BaseIdx 7 2176 | } 2177 | CGType { 2178 | Name "void" 2179 | Constructor "void" 2180 | } 2181 | CGType { 2182 | Name "ZCEventType" 2183 | Constructor "enum" 2184 | } 2185 | CGType { 2186 | Name "ZCDirection" 2187 | Constructor "enum" 2188 | } 2189 | CGType { 2190 | Width 2 2191 | Constructor "matrix" 2192 | NumDimensions 1 2193 | Dimensions [2] 2194 | } 2195 | CGType { 2196 | Constructor "matrix" 2197 | } 2198 | CGType { 2199 | Name "Parameters_Type2FuzzyLogicSyste" 2200 | Constructor "struct" 2201 | Members { 2202 | NumMembers 2 2203 | Member { 2204 | Name "Input1_Value" 2205 | } 2206 | Member { 2207 | Name "Input2_Value" 2208 | } 2209 | } 2210 | } 2211 | CGType { 2212 | Constructor "matrix" 2213 | NumDimensions 1 2214 | Dimensions [1] 2215 | } 2216 | } 2217 | RTWCGModules { 2218 | RTWCGModuleDefaults { 2219 | IsSignificantModuleFcnConst "yes" 2220 | NumFunctions 0 2221 | NumSubFunctions 0 2222 | HasConstants 0 2223 | HasExportedTypes 0 2224 | HasPublicTypes 0 2225 | HasVariables 0 2226 | HasRecursion 0 2227 | HasExportedSym 0 2228 | } 2229 | FunctionDefaults { 2230 | BlockName "" 2231 | BlockType "" 2232 | FunctionType "" 2233 | IsExported 0 2234 | IsShared 0 2235 | HasLocalData 0 2236 | SimStructArgIndex -1 2237 | TIDArgIndex -1 2238 | CPIArgIndex -1 2239 | IsEntryPointSubFcn 0 2240 | StackSize 0 2241 | FcnTID 0 2242 | NumTLCInterfaceFcns 0 2243 | NumArgs 0 2244 | ArgAccessed [] 2245 | ArgNames [] 2246 | ArgTypes [] 2247 | ArgSource [] 2248 | NumLocals 0 2249 | LocalAccessed [] 2250 | ProtoType "" 2251 | Abstract "" 2252 | PassThroughArgDefs "" 2253 | PassThroughArgs "" 2254 | NumFcnCalls 0 2255 | NumFcnHeaders 0 2256 | } 2257 | NumRTWCGModules 1 2258 | RTWCGModule { 2259 | TLCFileName "s0_b0_5egds" 2260 | RTWFcnConst { 2261 | HasInstanceSetup "no" 2262 | InitializeConditions_Function { 2263 | HasTidArg 0 2264 | HasCpiArg 0 2265 | TLCFileName "s0_b0_5egds_InitializeConditions" 2266 | StackSize 0 2267 | } 2268 | Outputs_Function { 2269 | HasTidArg 0 2270 | HasCpiArg 0 2271 | TLCFileName "s0_b0_5egds_Outputs" 2272 | StackSize 8 2273 | } 2274 | } 2275 | CGSystemIdx 0 2276 | NumFunctions 2 2277 | NumSubFunctions 0 2278 | SystemFunctions { 2279 | InitializeConditions 0 2280 | Outputs 1 2281 | } 2282 | SystemFunctionTypes { 2283 | InitializeConditions 0 2284 | Outputs 1 2285 | } 2286 | Function { 2287 | Name "InitializeConditions" 2288 | CPIArgIndex -1 2289 | FunctionType "Initialize" 2290 | } 2291 | Function { 2292 | Name "Outputs" 2293 | HasLocalData 1 2294 | CPIArgIndex -1 2295 | FunctionType "Output" 2296 | NumTLCInterfaceFcns 3 2297 | } 2298 | } 2299 | } 2300 | VarGroups { 2301 | NumVarGroups 1 2302 | VarGroupDefaults { 2303 | IsPointer 0 2304 | InstanceIdx 0 2305 | Alignment -1 2306 | Category "BlockIO" 2307 | LocalName "localB" 2308 | NonreusedName "" 2309 | ParentVarGroupIdx -1 2310 | MemberIdxInParent -1 2311 | NumSubStructs 0 2312 | VarGroupTypeTag "" 2313 | HasElement "" 2314 | } 2315 | VarGroup { 2316 | Name "Type2FuzzyLogicSystems_P" 2317 | Category "Parameter" 2318 | LocalName "localP" 2319 | SysIdx 0 2320 | InstanceIdx -1 2321 | CGTypeIdx 19 2322 | GlobalOffset 0 2323 | NumVarGroupElements 2 2324 | VarGroupElements [P0, P1] 2325 | } 2326 | VarGroupVarIdx [] 2327 | } 2328 | SharedFunctions { 2329 | } 2330 | SharedFunctionDecls { 2331 | } 2332 | } 2333 | -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/build_exception.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/build_exception.mat -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/Type2FuzzyLogicSystems_aux.tlc: -------------------------------------------------------------------------------- 1 | %% File: Additional function for 'Type2FuzzyLogicSystems' ================================= 2 | %% Abstract: 3 | %% This file contains additional functions needed by the 4 | %% Simulink Coder generated C code. It is created by rtwgen. 5 | %% 6 | 7 | %function GetModelUserFcnPrototypes() void 8 | %return "" 9 | %endfunction 10 | 11 | 12 | -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/Type2FuzzyLogicSystems_codeIRInfo.tlc: -------------------------------------------------------------------------------- 1 | %function FcnLoadCodeIRInfo() Output 2 | codeIRInfoStruct = load('D:/IPC_Projects/Fuzzy_T2_Toolbox/Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/codeIRInfo.mat'); 3 | codeInfo = codeIRInfoStruct.codeInfo; 4 | %endfunction 5 | 6 | %function FcnGetIsInheritedSampleTime() void 7 | %assign tmpIdx = 0 8 | %return tmpIdx 9 | %endfunction 10 | 11 | %function FcnGetUnsetDSMIdxFromIRInfo() void 12 | %assign tmpIdx = [] 13 | %return tmpIdx 14 | %endfunction 15 | 16 | %function FcnGetUnsetEIIdxFromIRInfo() void 17 | %assign tmpIdx = [] 18 | %return tmpIdx 19 | %endfunction 20 | 21 | %function FcnGetUnsetEOIdxFromIRInfo() void 22 | %assign tmpIdx = [] 23 | %return tmpIdx 24 | %endfunction 25 | 26 | %function FcnGetUnsetParamIdxFromIRInfo() void 27 | %assign tmpIdx = [] 28 | %return tmpIdx 29 | %endfunction 30 | 31 | -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/codeIRInfo.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/codeIRInfo.mat -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/s0_b0_5egds_Functions.tlc: -------------------------------------------------------------------------------- 1 | %implements s0_b0_5egds_Functions "C" 2 | 3 | -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/s0_b0_5egds_InitializeConditions.tlc: -------------------------------------------------------------------------------- 1 | %implements s0_b0_5egds_InitializeConditions "C" 2 | 3 | %function InitializeConditions(block, system) Output 4 | % 5 | % 6 | %assign fcnProtoType = "" 7 | %openfile fcnProtoType 8 | static void InitializeConditions(\ 9 | %assign comma = "" 10 | %closefile fcnProtoType 11 | % 12 | %endfunction 13 | -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/s0_b0_5egds_Outputs.tlc: -------------------------------------------------------------------------------- 1 | %implements s0_b0_5egds_Outputs "C" 2 | 3 | %function Outputs(block, system) Output 4 | %assign tlcOutputsFcnOfS0B2 = OpaqueTLCBlockFcn("Outputs", 0, 2, 0, 1) 5 | %\ 6 | %\ 7 | %assign fcnProtoType = "" 8 | %openfile fcnProtoType 9 | static void Outputs(\ 10 | %assign comma = "" 11 | %closefile fcnProtoType 12 | % 13 | %endfunction 14 | -------------------------------------------------------------------------------- /Simulink_Lib/Type2FuzzyLogicSystems_grt_rtw/tlc/s0_b0_5egds_TLCInterface.tlc: -------------------------------------------------------------------------------- 1 | %implements s0_b0_5egds_TLCInterface "C" 2 | 3 | %function getInputAddr_0_2_0_1_0_0(block, lcv, ucv, sigIdx, reim) void 4 | % 5 | 6 | %return "&Type2FuzzyLogicSystems_P.Input1_Value" 7 | %endfunction 8 | 9 | %function getInput_0_2_0_1_0_0(block, lcv, ucv, sigIdx, reim) void 10 | % 11 | 12 | %return "Type2FuzzyLogicSystems_P.Input1_Value" 13 | %endfunction 14 | 15 | %function getInputAddr_0_2_0_1_0_1(block, lcv, ucv, sigIdx, reim) void 16 | % 17 | 18 | %return "&Type2FuzzyLogicSystems_P.Input2_Value" 19 | %endfunction 20 | 21 | %function getInput_0_2_0_1_0_1(block, lcv, ucv, sigIdx, reim) void 22 | % 23 | 24 | %return "Type2FuzzyLogicSystems_P.Input2_Value" 25 | %endfunction 26 | 27 | %function getOutputAddr_0_2_0_1_0_0(block, lcv, ucv, sigIdx, reim) void 28 | % %% rtb_t2fis 29 | 30 | %return "&rtb_t2fis" 31 | %endfunction 32 | 33 | %function getOutput_0_2_0_1_0_0(block, lcv, ucv, sigIdx, reim) void 34 | % %% rtb_t2fis 35 | 36 | %return "rtb_t2fis" 37 | %endfunction 38 | 39 | -------------------------------------------------------------------------------- /Simulink_Lib/slblocks.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function blkStruct = slblocks 14 | Browser(1).Library = 'Fuzzy_Type2_Lib'; 15 | Browser(1).Name = 'Interval Type-2 Fuzzy Logic Systems Toolbox'; 16 | Browser(1).IsFlat = 0;% Is this library "flat" (i.e. no subsystems)? 17 | blkStruct.Browser = Browser; 18 | clear Browser; -------------------------------------------------------------------------------- /Simulink_Lib/slprj/grt/Type2FuzzyLogicSystems/tmwinternal/minfo.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmettaskin/type-2-fuzzy-logic-systems-matlab-toolbox/9d95883c1e9310bb248b6589d9bc09ee0aa5c841/Simulink_Lib/slprj/grt/Type2FuzzyLogicSystems/tmwinternal/minfo.mat -------------------------------------------------------------------------------- /Simulink_Lib/slprj/sl_proj.tmw: -------------------------------------------------------------------------------- 1 | Simulink Coder project marker file. Please don't change it. 2 | slprjVersion: 8.0_41_001 -------------------------------------------------------------------------------- /fuzzyt2.m: -------------------------------------------------------------------------------- 1 | % IT2-FLS Toolbox is free software: you can redistribute it and/or modify 2 | % it under the terms of the GNU General Public License as published by 3 | % the Free Software Foundation, either version 3 of the License, or 4 | % (at your option) any later version. 5 | % 6 | % IT2-FLS Toolbox is distributed in the hope that it will be useful, 7 | % but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | % GNU General Public License for more details. 10 | % 11 | % You should have received a copy of the GNU General Public License 12 | % along with IT2-FLS Toolbox. If not, see . 13 | function fuzzyt2() 14 | %% add path 15 | hpath=fileparts(mfilename('fullpath')); 16 | addpath(hpath) 17 | addpath([hpath,'\Read_Eval_Functions']) 18 | addpath([hpath,'\Simulink_Lib']) 19 | addpath([hpath,'\Images']) 20 | 21 | %% add shortcuts 22 | helper.addShortcuts; 23 | 24 | %% Simple example IT2-FLS Toolbox 25 | % load t2fis file, check the Examples\ExampleFiles folder for examples 26 | t2fis=readt2fis('test.t2fis') % creates a Structure array 27 | x=[0.1,0.5]; %input vector 28 | y=evalt2(x,t2fis) % output of IT2-FLS -------------------------------------------------------------------------------- /test.t2fis: -------------------------------------------------------------------------------- 1 | [System] 2 | Name='Test' 3 | Type='sugeno' 4 | Version=2.0 5 | NumInputs=2 6 | NumOutputs=1 7 | NumRules=4 8 | AndMethod='prod' 9 | OrMethod='probor' 10 | ImpMethod='prod' 11 | AggMethod='sum' 12 | DefuzzMethod='wtaver' 13 | TypeRedMethod='KM' 14 | 15 | [Input1] 16 | Name='input1' 17 | Range=[-1.5 1.5] 18 | NumMFs=2 19 | MF1U='mf1U':'trapmf',[-4.2 -1.8 -0.5 1.5 1] 20 | MF1L='mf1L':'trimf',[-4.5 -1.5 0.5 1] 21 | MF2U='mf2U':'trapmf',[-1.5 0.5 2 4.1 1] 22 | MF2L='mf2L':'trimf',[-0.5 1.5 4.5 1] 23 | 24 | [Input2] 25 | Name='input2' 26 | Range=[-1.5 1.5] 27 | NumMFs=2 28 | MF1U='mf1U':'trapmf',[-4.2 -1.8 -0.5 1.5 1] 29 | MF1L='mf1L':'trimf',[-4.5 -1.5 0.5 1] 30 | MF2U='mf2U':'trapmf',[-1.5 0.5 2 4.1 1] 31 | MF2L='mf2L':'trimf',[-0.5 1.5 4.5 1] 32 | 33 | [Output1] 34 | Name='output1' 35 | Range=[-1 1] 36 | NumMFs=4 37 | MF1='mf1':'constant',[-1 -0.9] 38 | MF2='mf2':'constant',[-0.6 -0.4] 39 | MF3='mf3':'constant',[0.4 0.6] 40 | MF4='mf4':'constant',[0.9 1] 41 | 42 | [Rules] 43 | 1 1, 1 (1) : 1 44 | 1 2, 2 (1) : 1 45 | 2 1, 3 (1) : 1 46 | 2 2, 4 (1) : 1 47 | --------------------------------------------------------------------------------