This action might not be possible to undo. Are you sure you want to continue?

By Heikki N. Koivo

©

2006

1

2.1. Fuzzy sets

Membership functions

Universal discourse U set of elements, {u}. Fuzzy set F in universal discourse U: Membership function µF (membership function).

µF :U →[0,1]

Fuzzy set

F = {x, µ F ( x) x ∈ U } The value of the membership function µF(u) describes the degree of membership of u in the fuzzy set F. It takes values between 0 and 1.

µ(u) 1 bellshaped triangular trapezoidal singleton

u

Fig.2. 1. Membership functions may assume different shapes like bell-shaped, triangular, trapezoidal and singleton.

2

2. 2. USING MATLAB Fuzzy Toolbox GUI PROBLEM 2.1. Let the room temperature T be a fuzzy variable. Characterize it with three different (fuzzy) temperatures: cold,warm, hot. SOLUTION: 1. First define the temperature range, e.g. [00,400]. 2. When MATLAB is open, then open GUI (GUI = Graphical User Interface) by typing fuzzy The result is shown below:

1. Input membership functions 2. Fuzzy inference system 3. Output membership functions

Fig.2.2. GUI of Fuzzy toolbox. Study the content of GUI to have an overall understanding before proceeding.

3

Activation is shown by a red boundary on the block. Another way to do the same is to use View menu (cf. Input block is again activated first. This is needed when defining membership functions.2. the MEMBERSHIP FUNCTION EDITOR opens up.3. Editing membership functions from View menu.Next activate input membership block by moving mouse on top of it and by clicking once. Figure below). If you click twice. 4 . Fig.

Fig. Next click Close or anywhere in the light grey area above with the mouse.4.2. First change Range to the one given in the problem or to [00.400]. 5 . The result is shown below. Then you can correct the figures in the range domain as you would correct text in a text document. This is done by moving the cursor to the Range area and clicking once. Display to edit input membership functions. Note that you have to leave space between the numbers.

2.6. Now you are ready to define new membership functions. Choose Add MF's from EDIT menu. Fig.Fig.5. The following display is shown. 6 .400]. Change the range of input variable to [00. Type and number of membership functions can be chosen.2.

) The result is shown below. Click OK. 7 . Different membership functions can be found under MF type. five gaussian membership functions. These will divide the range into three equal parts. The result of choosing three. Note that the default names for the membership functions are mf1.Default value is three triangular (trimf) (3) membership functions as seen on the display.2. triangular membership functions. which by default are named mf1.g.7. if you are happy with the default values. Fig. otherwise make your own choice. mf2 and mf3. (Try e. mf2 and mf3.

The membership function of union A ∪ B is defined by taking the maximum of membership functions of A and B. Their corresponding membership functions are µA and µB. Fuzzy set operations Let A and B be two fuzzy sets in universal discourse U.2.2. intersection and complement are defined by the membership functions as follows: Union µ A∪ B (u ) = max{µ A (u ). u 8 . The basic set operations union.3. µ B (u )}. ∀ u ∈ U 1 µ A∪B (u) µ B (u ) µ A (u ) Fig. 8.

9 .10.Intersection µ A∩ B (u ) = min{µ A (u ).2. Complement The membership function of the complement of a fuzzy set A. The membership function of intersection of fuzzy u sets A ∩ B is defined by taking the minimum of membership functions of A or B. µ B (u )}. Membership functions of a fuzzy set A and its complement A .2. ∀ u ∈ U µ A∩ B 1 µ A (u ) µ B (u ) Fig. A is defined as follows µ A (u ) = 1 − µ A (u ). ∀ u ∈ U µ A (u ) 1 µ A (u ) u µ (u ) 1 b ells hap ed t ria ngul ar tr apez oid al s in gleton u µ (u ) 1 b ells hap ed t ria ngul ar tr apez oid al s in gleton u Fig.9.

3. µ B (v)}. Fuzzy logical operations The membership function of the logical operation or of two fuzzy sets A and B is µ A∨ B (u. u ∈ U ∧ v ∈ V The membership function of the logical operation not of a fuzzy set A is µ A (u ) = 1 − µ A (u ). v) = max{µ A (u ).2. u ∈ U 10 . u ∈ U ∧ v ∈ V The membership function of the logical operation and of two fuzzy sets A and B is µ A∧ B (u . µ B (v)}. v) = min{µ A (u ).

. Rule 2: If x is A2 and y is B2 then z is C2. µC N i ( z )) 11 . A2. and 2.. B2 and C2 are fuzzy sets. µC ' ( z ) = T (α i . B1 and C1. or 3.. µC2 ( z ). Interpretation: 1. then corresponds to corresponds to corresponds to min max min MORE GENERALLY 1. Here A1.EXAMPLE RULEBASE Rule 1: If x is A1 and y is B1 then z is C1. µC ( z ) = T ( µC1 ( z ). µCi ( z )) To combine the rules * 3. µ Bi ( y0 )) 2.. α i = T ( µ Ai ( x0 ).

µC1 ( z )) 1 Evaluate the second rule 1. µ B1 ( y0 )) µC ' ( z ) = min(α1. α1 = min( µ A1 ( x0 ). 2.FUZZY INFERENCE (AND-OR) 1 µA ( x) 1 1 µB ( y) 1 µC ( z) 1 z µC' 1 () 1 µC (z) 0 µA2( x) x 0 µB 2( y) y 0 µC 2( z) z 1 1 1 0 z µ C' 2 () z 0 x0 x 0 y0 y min 0 z Evaluate the first rule 1. µ ' ( z ) = min(α 2 . µC ( z )) Combine both rules (Aggregate) Defuzzify Compute the center of gravity 12 C2 2 µC ' ( z ) = max( µC ' ( z ). µC ' ( z )) 1 2 . α 2 = min( µ A ( x0 ). µ B ( y0 )) 2 2 2.

OUTPUT MEMBERSHIP FUNCTIONS SINGLETONS µA (x) 1 1 µB (y) 1 1 µC (z) 1 1 µ C' ( z) 1 µC (z) 1 0 µA (x) 1 2 x 0 µB (y) 1 2 y 0 µC (z) 1 2 z 0 µ C' ( z) 2 z 0 x0 0 x y0 y 0 min z 13 .

FUZZY INFERENCE (PRODUCT) 14 .

b ) ≤ T ( c. a ) = a . b). d ) T (a.3.0) = 0 commutativity associativity nondecreasing boundary Example: Intersection of sets. c)) a ≤ c ∧ b ≤ d = T ( a . a ) T (T (a. T-norm Triangular norm Mapping T : [0.1] → [0. b) = T (b.1. b) ba 15 . T (0. The most common T-norms are 1.2.1]× [0. c) = T (a. Minimum 2. REMARK: In fuzzy control T-norm is used to connect different propositions in connection of and-operation.1) = T (1. T (b. Product min(a. The arguments are then the corresponding membership functions.1] is called T-norm if it satisfies the following criteria: T (a.

2. b) 2.3. In probability theory a+b-ab 3. For triangular membership functions sum (a+b) is used (although it does not satisfy the above conditions) 16 .1]× [0. The most common T-conorms: 1. a ) = a . Maximum max(a. T * (1.1] is called T-conorm. T-conorm Triangular conorm Mapping T * : [0. if it is T-norm and in addition satisfies T * (a.2.1) = 1 Example 2.2: T-conorm is generally used to connect propositions in connection of or-operation.1] → [0.0) = T * (0.

and their complements A and B . Then (GMP) Fact 1: x is A Premise 2: Conclusion: If x is A then y is B y is B (GMT) Fact 1: Premise 2: Conclusion: y is B If x is A then y is B x is A 17 . Generalized Modus Ponens (GMP) (forward chaining) 2.4. Generalized Modus Tollens (GMT) (backward chaining) Example 2.3: Consider two fuzzy sets A and B. Fuzzy reasoning 1.2.

You are driving car A on a highway. 18 . which satisfies the requirements. c. b.11. Use fuzzy reasoning to check the operability of the rulebase. You want to keep a safe distance to car B in front of you.4: Car driving A Distance d B SAFE DISTANCE Fig. Form the rule base. Design a (simplified) fuzzy-logic system.Example 2. Determine the required fuzzy variables (input/output) and their ranges.2. Cars A and B on a highway. Proceed as follows: a.

Start with a simple case. Activate the input window. In MATLAB type » fuzzy This opens the GUI.SOLUTION: a. medium. Membership functions for OUTPUT: Breaking power b (%): large. Membership functions for INPUT: Distance d (meters): short. 19 . none We will use the fuzzy toolbox to define the fuzzy system by giving numerical values for the variables indicated. medium. INPUT: Distance d OUTPUT: Breaking power b (gas pedal) Three (3) membership functions are chosen for both input and output. long. Fuzzy variables.

2.Give a name to the fuzzy input variable. First define the range. 20 . Fig. Next click the input block twice with mouse to open the membership function window. Call it distance. Click Close.12. say from 0 to 30 m/s. Naming the input variable in GUI.

Give a name to each: Call them high. Set the range in GUI. When you are finished. click Close. 21 . medium.Fig. Next choose from Edit Add MFs.13. 2. Pick the default values: 3 triangular membership functions. and short.

break. The following GUI display is obtained. Define the name of the output. and its range. medium and no. The middle one has been activated and renamed as medium. Three triangular membership functions have been chosen for the input variable distance. Use three membership functions: hard. breaking power. Repeat the same procedure with the output b. 2. 22 .Fig.14.

The last one has been activated and renamed as hard. What is missing from the fuzzy system now is the rule base.Fig.15. Open View menu and click Edit rules. Then the following display opens. Three triangular membership functions are chosen for the output variable breaking. 23 . 2.

In this case we only have one input variable. the input side.16. so the connective is not used. Typical rule is 24 . Here a simple-minded rule base is constructed based on driving experience. On the left. brake.Fig. distance. indicates the importance of the rule in question. the Connection block is in the lower left-hand corner. Rule Editor display. On the right. the output side. The construction of the rule base is the hardest part of the design task. The right-hand side has the membership functions of the output. The weight factor (default value = 1). which are connected either by and or or. If the input side has several variables. 2. The left-hand side contains the membership functions of the input.

With mouse choose the membership function low for the distance and hard for brake. rule base is now complete. The result is seen below. one for medium distance and the other for long distance. Setting up a rule with Rule Editor. 2. Click Close.17. Let us set two other rules. This is done in the figure above. 25 . Then click Add rule. Our simple. Fig.If distance is low. then brake is hard.

2. 26 .18. Complete rule base of three rules. The Toolbox provides two more interesting ways expressing the rule base.. i.Fig.e. Note the weighting parameter (1) at the end of each rule. all rules have the same weighting. Now the design of the fuzzy system is complete.

19. The other forms are symbolic and indexed. Check in what form the rule base is given in each case. choose from View menu View rules. 27 . 2.Fig. Check under Options and there choose Format. Viewing rules gives you the overall picture of the developed fuzzy system. The rule base can be expressed in two other ways in GUI. Here verbose format is shown. From the main FIS editor. Under that you can see that the rules as shown are given verbose.

28 . By choosing View the rule base can be viewed differently. 2. The display View rules is shown below.20.Fig.

The red line on the left indicates the value of the input. indicates the output value. There are three rules and the corresponding triangular membership functions displayed. At this point it is a fuzzy set. 50%. in the figure center of gravity has been chosen. 29 . 2. On the left-hand side you can see the input. brake side. Similarly the bar on the right hand side.21. Applying defuzzification method. The rule base can be displayed graphically. In the right-hand side lower corner is the result of fuzzy reasoning. a crisp value is obtained. distance side and on the left the output. 15 m.Fig.

22. Different input values can be tried by moving the red. 2. vertical line on the left-hand side (Fig. 2.23). Result of fuzzy reasoning is brake = 50%.Fig. 30 .

24). This is where the power of fuzzy systems is strong (Fig. 2.Fig. It is clear that our map is nonlinear. 31 .23. Changing the input value results in different output values. Choose View menu and under it View surface. Finally. 2. the input-output mapping can be observed by viewing surface.

The fuzzy system viewed as input-output mapping.24. 32 . 2.Fig.

Here only the main steps are shown.EXAMPLE 2.continues What is missing in Example 2. 35 .4? A Distance d B SPEED! (relative speed between vehicles A and B). one output. braking power.5: Car Driving . SOLUTION: Set up a new rule base with two inputs distance and speed.

Fig. 36 .25. medium. break. The second input can be added by opening Edit menu. Otherwise the steps are as before. Remember to give a name for the added input. and one output. Call it velocity. 2. distance and velocity. Fuzzy system with two inputs. Only velocity membership functions are shown because they are new. Note that the speed range is from -40 to 40 km/h and the range has been divided into three membership functions: slow. and high speed.

which are easy to understand (Fig. Of course. 2.27). 37 . velocity.Fig. Other rules could be used as well. the rules are not unique. Membership functions for the new input. Eight rules have been constructed.26. 2. The rule base must be viewed and tested to see its effectiveness and how well the system specifications are satisfied.

A rule base for Example 2. 2.Fig. 2.27. Viewing the rules is shown in Fig. 38 .28.5.

If the result is not satisfactory. then refine the system. Again you can test the system by choosing different values of inputs. The rule base is viewed graphically. E. it seems that the area of short distance and high speed does not give strong enough braking response. 2.Fig.28. Different inputs can be chosen to see what the output will be. 39 .g.

Note that the right hand-side corner is flat with value zero over a fairly large area. The surface view of the constructed rule base. You can change that by introducing a new membership function little for breaking power.29. 2. 40 . This is done below. You also have to change the rule base.Finally. Fig. the surface view of the rules is shown.

Fig.5.2.0 .g. triangular membership functions at the input and singletons at the output positioned at yi.30.5 0. Sugeno-style fuzzy inference The result of Sugeno reasoning is an exact number.25 0 0 0. 2.0.1. The data can be represented using Mamdani reasoning with e. Default display of FIS Editor with Mamdani reasoning.25 1.0 1. 41 . x y .0 The data is from the function y = x2. Consider input-output data given in the table.5 0.0 1.

This is seen in the above figure. so let's first choose triangular membership functions at the output.31. Choose as many triangular membership functions for input variable. 42 . which is one of the data points. Mamdani reasoning does not support singletons. the maximum of which occurs exactly at a given data point. 2. say mf3 has maximum at x = 0. The number of xi points is five.Fig. For each data point generate a triangular membership function.

2. 2.Fig. Choose as many triangular membership functions for output variable.32. 43 . Make the basis of output triangular membership functions as narrow as possible to make them resemble singletons.32. Fig. Then make the base of the triangles narrow. The number of yi points three. so that they resemble singletons.

32. They have nonzero value exactly at the output data point. Why? Next set the rules to be If x is mfi then y is omfi . Only three membership functions are needed at the output.Observe again the position of singletons. The rule base corresponding to the input-output data shown in the Table. We can view the rules by View rules 44 . 2. Fig. Complete rule base for the example is shown below.

33. The result of our data fitting can be shown below 45 .Fig. The complete rule base of the example. 2.

2.34. 46 . The resulting fuzzy system approximating the given data. Overall shape is that of parabola. Add four more data points. EXERCISE: Keep the range the same.Fig. more data points would be needed. The fit is exact at the given data points. Repeat the procedure and compare the results. but to have a better fit.

Then activate the input and name it x.The same procedure as above can be produced with Sugeno reasoning. The 47 . Click Ready so that your choice is recorded. FIS Editor for Sugeno reasoning. In Mamdani reasoning the determinism is produced with singletons. 2. the output side. In Sugeno reasoning the consequence.35. In the FIS editor choose New Sugeno FIS. is deterministic: If x is X i then y = yi. Similarly activate output and name it y. Let the input range be [-1 1]. Fig. Next Edit membership functions. Next repeat the same for output. Let us repeat the above example with Sugeno reasoning. Determine the input membership functions as before by Add MF's (5 triangular).

Choose three. Fig. Membership Function Editor in Sugeno type of fuzzy system. There are three different values of output. so choose 3 as Number of MFs. 48 .37. which is default value. Clicking OK results in Fig. MF type constant corresponds to Mamdani singletons.range is [0 1]. 2. Then Add MF's.36. At this point the following appears. constant output membership functions. 2.

The final task is to form the rulebase. Fig. 49 . Choose Edit rules and write them in as before.The values of the constant membership functions are determined by activating them by clicking with the mouse. Activate membership function mf2.38. Now you change the name and value of the constant. 2.

Fig.39. The rule base for the example in Sugeno type of fuzzy system. 2. The Sugeno FIS system is now complete. Let us view the result. First the overall rules 50 .

The complete rule base of the example in the case of Sugeno type of fuzzy system.Fig. 2.40. Then the Surface View. 51 .

Fig. 2.41. The resulting fit of Sugeno type of fuzzy system.

The result is the roughly the same as we obtained before. Trying gaussmf membership functions results in the following approximating system.

Fig. 2.42. Fuzzy Sugeno system with gaussian type of membership functions.

52

More generally the above procedure would be the following. The inputoutput data is given by

x x0 x1 M xn

The rules would be of the form If x is X i then y = yi. Then Sugeno type of reasoning with weighted average leads to

y y0 y1 M yn

y ( x) = i =1 m ∑ µ X i ( x)

i =1

yi = discretization points of membership functions

∑ µ X i ( x) yi

m

m = number of rules

REMARK: Weighted average requires that the rule base is complete and input fuzzy membership functions cover the input space. Otherwise there is a danger to divide with zero.

53

Sugeno reasoning allows us to use also functions of input x, not only constants, on the right hand side. The rules would look like If x is X i then y = fi ( x) . Function fi can be a different nonlinear mapping for each rule. x may be a vector and more complicated rule structures can also appear. Simplest examples of functions fi are straight lines. Let i = 2. Then

y = p1x + r1

y = p2 x + r2

This is supported by Fuzzy Toolbox. More general functions can also be used, but these have to be set up by yourself. EXAMPLE: Consider again the example above. Set up a Sugeno system with five membership functions as before. Use three straight lines at the output: One with a negative slope, one constant, and one with a positive slope. Start with very simple ones

1: y = − x

2: y = 0

3: y = x

Define them by Add MF's. Choose linear type.

Fig. 2.43. Choose linear form of membership functions instead of constant.

54

44.The two parameters for each straight line can be chosen in Params box. The rule base could be e. 55 . 2. Fig. Fig. 2. The slope is first and then the constant.g.45.

2. The Surface View becomes: 56 .The overall view of the rules is shown below.46. Fig.

Combining results of all the rules leads to a weighted average y ( x) = i =1 m ∑ µ X i ( x) i =1 57 ∑ µ X i ( x ) fi ( x ) m .47.Fig. This would require further fine-tuning of parameters.25. 2. Suppose the rules are of the form If x is X i then y = fi ( x) . but does not agree as well at point x = 0. The result is smoother than before.5. y = 0.

where m = number of rules.48. 58 . y2. 2. the membership functions smooth (interpolate) the output function fi. The bold line is the final result. represent the local models. The straight lines yi. and y3. This is illustrated below for the case of straight lines y1.2.3. A function defined by Sugeno model. y1 y3 y2 µ X1 ( x) µ X 3 ( x) Fig. i = 1. The interpretation is that for a given value of x.

L. xn ] and wi depends on the applied T-norm for logical and.L. i = 1. then i =1 ∑ wi (x) n . i =1 m REMARK: Sugeno systems using constants or linear functions in the consequence are clearly parameterized maps. n . Therefore it is possible to use optimization techniques to find best parameters to fit data instead of trying to do it heuristically. Basis Functions and curve fitting Mendel-Wang's Mamdani type. the expression above may change. k =1 n where ckj are real-valued parameters and specific to each rule. xn ) where the consequences of the fuzzy rules are functions of the input vector x = [ x1. the aggregate result is obtained by weighted average. wi = ∏ µ Ai ( x).K. If product is chosen and the number of rule is m. but will always have similar structure.The rules can be more general like i i If x1 is A1 and … and xn is An then yi = f i ( x1.L. fuzzy logic system is given by 59 . i ∑ wi (x) y (x) n y (x) = i =1 where x = [ x1. xn ] . Depending on the choice of T-norm and defuzzification. A general linear function of Sugeno type at the output is y j = c0j + ∑ ckj xk . Since each rule has a crisp output.

Comparing the equation with the Sugeno expression. the result is the same. The rules are of Mamdani type. The membership function µ j ( xi ) corresponds to the input xi of the rule j. T-norms and Tconorms. It is useful to define a fuzzy basis function b j ( x) = ⎞ ∑ ⎜ ∏ µ X j ( xi ) ⎟ ⎜ ⎟ j =1⎝ i =1 i ⎠ i =1 i n ⎛m ∏ µ X j ( xi ) m where the denominator normalizes the product of membership functions so that the sum of basis functions yields one at each point. although they are not always orthogonal. 60 . The andXi connective in the premise are realized with product and defuzzification with Center of Gravity method. The fuzzy system can now be written in a simple way y (x) = ∑ wibi (x) . Functions bj are called basis functions.⎛m ⎞ w j ⎜ ∏ µ j ( xi ) ⎟ ∑ ⎜ ⎟ X j =1 ⎝ i =1 i ⎠ y ( x) = . it is easy to see that choosing y j to be constant and w j = y j . it can be interpreted as such. n ⎛m ⎞ ∑ ⎜ ∏ µ X j ( xi ) ⎟ ⎜ ⎟ j =1⎝ i =1 i ⎠ n where w j is the place of the output singleton. j =1 n Although the above does not look like a fuzzy system. because it is formed using membership functions. This form further implies the use of optimization techniques in determining the parameters in a fuzzy system in the best way.

61 .

plot(x.5 1.5 − 0.5 0 0. grid 62 .0 0 . Least squares fit: Form a cost function J (a.2].2 is given.b) with respect to (a.1. Plot the data x=[-1 -.y).2 -0.b).2 0.3 0 0.2 .3 0.2 0. Find the best a and b to fit the data. Minimize J(a.0.0 − 1.Curve fitting Suppose input-output data x y .4 1. y=[-1. Assume a linear model y = ax + b . b) = ∑ ( yi − axi − b )2 i =1 n This represents the cumulative error.4 1.5 1].

Levenberg-Marquardt. One special one is ANFIS which is included in the Fuzzy Toolbox. ANFIS is used later on fuzzy systems. LSQNONLIN solves problems of the form: 63 . 2. These include gradient (steepest descent).Fig. Plotting data. They can be studied by typing optdemo. GaussNewton. Many numerical optimization schemes can be applied to solve the minimization problem.49. These are included in the MATLAB Optimization Toolbox. Apply here LSQNONLIN in MATLAB help LSQNONLIN LSQNONLIN Solves non-linear least squares problems.

(FUN(X) is summed and squared implicitly in the algorithm.X0) starts at the matrix X0 and finds a minimum X to the sum of squares of the functions in FUN.1*x+0.yy.2 -.[1 4]).^2} x vectors or matrices. Apply to the current problem lsqnonlin('([-1.^2)).06 plot(x. NOTE: FUN should return FUN(X) and not the sum-of-squares sum(FUN(X)..'or') hold % Current plot held plot(x.2 .5 1]-x(2)*ones(1.[0 0]) ans = 1.y) grid 64 . FUN accepts input X and returns a vector (or matrix) of function values F evaluated at X.[2 3 4]) where MYFUN is a MATLAB function such as: function F = myfun(x) F = sin(x).2] -x(1)*[-1 -.min sum {FUN(X). where X and the values returned by FUN can be X=LSQNONLIN(FUN.) Examples FUN can be specified using @: x = lsqnonlin(@myfun.5))'.5 0 .3 . yy=1. FUN can also be an inline object: fun = inline('sin(3*x)') x = lsqnonlin(fun.4 1.0600 Plotting both the data and the fitted straight line the figure below is obtained.1000 0.

If the errors in the data.N) returns the polynomial coefficients P and a structure S for use with POLYVAL to obtain error estimates on predictions. If a third order polynomial is used. Then the command is polyfit. the degrees of freedom (df). in a least-squares sense.S] = POLYFIT(X. One could use also polynomial fit. 2.Y. Y.Fig.N) finds the coefficients of a polynomial P(X) of degree N that fits the data. [P.Y. and the norm of the residuals (normr) as fields. are independent normal with constant variance. P(X(I))~=Y(I).50. the command works as follows: 65 . POLYVAL will produce error bounds which contain at least 50% of the predictions. This command fits a polynomial of given degree to the data: POLYFIT Fit polynomial to data. The structure S contains the Cholesky factor of the Vandermonde matrix (R). POLYFIT(X. Result of linear curve fitting.

hold.x).06.y). and plot all the data and the least square straight line and third order polynomial to the same figure.'xr'. grid This yields 66 . yy=1.[p.5333 0.01:1. Apply that y1=polyval(p.y.6667 -0. For that there is a convenient command polyval(p.1429 0.yy. plot(xx.y1.xx).0956 Here p gives the coefficients of the polynomial in descending order (highest power first). y1=polyval(p.s]=polyfit(x. xx=-1:0.'obl').1*xx+0. the polynomial must be evaluated at the points x.1314 s = R: [4x4 double] df: 1 normr: 0.3) p = 0.xx. To compare the answer with the least squares fit. plot(x.x).

The joy of MATLAB commands in curve fitting is not complete. 2.51. Splines offer many times the best fits. 67 . Curve fitting on given data (blue). straight line (black) and third order polynomial fit (red).Fig. if spline functions and their fit are not mentioned. Study MATLAB command spline.

- fuzzy_tb
- Fuzzy Logic and Neural Networks_ Basic Concepts & Application_8122421822
- Fuzzy Matlab Example
- CDI Fuzzy Toolbox
- MATLAB Aided Control System Design Intelligent Control
- fcslide3
- Basins of Attraction
- 10 - Sugeno-TSK Model
- ANFIS_eg
- petrik_masters_thesis
- iiser3
- 1_Relations and Functions
- Lecture 5
- a New Method for Ranking Fuzzy Numb
- Elementary Functions
- Exercise FSF v0.0
- Sundials TB
- Talk FunctionPointsv2.2.23.2004
- Fuzzy Logic Controller
- MATLAB
- Cost Functions
- Book
- NM_03b Non Linear Eq.new1
- Harmonic
- Matlab Fuzzy
- e 174460
- Multivalued Function
- Homotopy
- Value Analysis
- Optimization MATLAB Exercises
- Basics Using Matlab Fuzzy Toolbox

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue reading from where you left off, or restart the preview.

scribd