SlideShare a Scribd company logo
1 of 21
Plotting in Matlab and
Fuzzy Logic Toolbox
-------An Introduction
PLOT (2-D plotting)
 Linear plot.
 PLOT(X,Y) plots vector Y versus vector X.
If X or Y is a matrix, then the vector is plotted versus the rows or
columns of the matrix, whichever line up.
If X is a scalar and Y is a vector, length(Y) disconnected points
are plotted.
 PLOT(Y) plots the columns of Y versus their index.
If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)).
In all other uses of PLOT, the imaginary part is ignored.
Line plot
x = 0 : 0.05 : 5;
y = sin(x .^ 2);
plot(x, y);
Other 2-D plotting
 bar
 stairs
 errorbar
 polar
 stem
MESH (3-D plotting)
% Mesh Plot of Peaks
z=peaks(25);
mesh(z);
Other 3-D plotting
 surf
 surfl
 contour
 quiver
 slice
Example
Membership Function of “young”
Filename: mfyoung.m
function y = mfyoung(x) % member function: young
y = exp(-power(x/20,2));
2
20






−
=
x
young ey
Membership Function of “old”
Filename: mfold.m
function y = mfold(x) % member function: old
y = exp(-power((x-100)/30,2));
2
30
100





 −
−
=
x
old ey
2
oldveryold yy =
2
youngveryyoung yy =
( )veryoldveryyoungveryoldnotandveryyoungnot yyy ,min____ =
( )veryoldveryyoungveryoldorveryyoung yyy ,max__ =
x = 0:1:100; % people age between 0 and 100.
y=min((1-power(mfyoung(x), 2)),(1-power(mfold(x), 2)));
% not very young and not very old.
plot(x,y)
y=max(power(mfyoung(x), 2), power(mfold(x), 2));
% very young or very old
figure, plot(x,y) % open a new figure window and plot
Fuzzy Logic Toolbox (GUI)
 Start the toolbox:
FIS Editor
MF Editor
Rules Editor
Command Line functions
 plotfis
 plotmf
 gensurf
Built-in membership functions
Building a FIS from scratch
 The Basic Tipping Problem. Given a
number between 0 and 10 that represents the
quality of service at a restaurant (where 10 is
excellent), and another number between 0 and
10 that represents the quality of the food at that
restaurant (again, 10 is excellent), what should
the tip be?
Building a FIS from scratch (cont.)
– 1. If the service is poor or the food is rancid, then tip
is cheap.
– 2. If the service is good, then tip is average.
– 3. If the service is excellent or the food is delicious,
then tip is generous.
– We'll assume that an average tip is 15%, a
generous tip is 25%, and a cheap tip is 5%. It's also
useful to have a vague idea of what the tipping
function should look like.
Decision Surface
 http://www.mathworks.com/access/helpdesk/help/
 http://www.mathworks.com/access/helpdesk/h
elp/toolbox/fuzzy/fuzzy.shtml

More Related Content

What's hot

Dm week01 linreg.handout
Dm week01 linreg.handoutDm week01 linreg.handout
Dm week01 linreg.handoutokeee
 
Lesson 3.3 3.4 - 1 st and 2nd Derivative Information
Lesson 3.3 3.4 - 1 st and 2nd Derivative InformationLesson 3.3 3.4 - 1 st and 2nd Derivative Information
Lesson 3.3 3.4 - 1 st and 2nd Derivative InformationSharon Henry
 
Second Derivative Information
Second Derivative InformationSecond Derivative Information
Second Derivative InformationSharon Henry
 
Lecture 12(point of inflection and concavity)
Lecture 12(point of inflection and concavity)Lecture 12(point of inflection and concavity)
Lecture 12(point of inflection and concavity)FahadYaqoob5
 
8.1 exponential growth
8.1 exponential growth8.1 exponential growth
8.1 exponential growthhisema01
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introductionAhmed Atef
 
Unit 3
Unit 3Unit 3
Unit 3ypnrao
 
Lecture 1: basic syntax
Lecture 1: basic syntaxLecture 1: basic syntax
Lecture 1: basic syntaxVivek Bhargav
 
Graphing Absolute Value
Graphing Absolute ValueGraphing Absolute Value
Graphing Absolute Valueswartzje
 
3.3 graphs of exponential functions
3.3 graphs of  exponential functions3.3 graphs of  exponential functions
3.3 graphs of exponential functionshisema01
 
Pre-Cal 30S January 19, 2009
Pre-Cal 30S January 19, 2009Pre-Cal 30S January 19, 2009
Pre-Cal 30S January 19, 2009Darren Kuropatwa
 
Xmss ict lesson sec 2 qe wksheet
Xmss  ict lesson sec 2 qe wksheetXmss  ict lesson sec 2 qe wksheet
Xmss ict lesson sec 2 qe wksheetbryan
 
7 2 Graphing Simple Quadratic Functions
7 2 Graphing Simple Quadratic Functions7 2 Graphing Simple Quadratic Functions
7 2 Graphing Simple Quadratic FunctionsBitsy Griffin
 
7th PreAlg - Lesson 41--Dec16
7th PreAlg - Lesson 41--Dec167th PreAlg - Lesson 41--Dec16
7th PreAlg - Lesson 41--Dec16jdurst65
 
QR 1 Lesson Notes 8 - Motivation for Modelling with Linear Functions PP Show
QR 1 Lesson Notes 8 - Motivation for Modelling with Linear Functions PP ShowQR 1 Lesson Notes 8 - Motivation for Modelling with Linear Functions PP Show
QR 1 Lesson Notes 8 - Motivation for Modelling with Linear Functions PP ShowRoss Flek
 
Generate and test random numbers
Generate and test random numbersGenerate and test random numbers
Generate and test random numbersMshari Alabdulkarim
 
5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!A Jorge Garcia
 

What's hot (20)

Exam 3 math107 review
Exam 3 math107 reviewExam 3 math107 review
Exam 3 math107 review
 
Dm week01 linreg.handout
Dm week01 linreg.handoutDm week01 linreg.handout
Dm week01 linreg.handout
 
Lesson 3.3 3.4 - 1 st and 2nd Derivative Information
Lesson 3.3 3.4 - 1 st and 2nd Derivative InformationLesson 3.3 3.4 - 1 st and 2nd Derivative Information
Lesson 3.3 3.4 - 1 st and 2nd Derivative Information
 
Second Derivative Information
Second Derivative InformationSecond Derivative Information
Second Derivative Information
 
Lecture 12(point of inflection and concavity)
Lecture 12(point of inflection and concavity)Lecture 12(point of inflection and concavity)
Lecture 12(point of inflection and concavity)
 
8.1 exponential growth
8.1 exponential growth8.1 exponential growth
8.1 exponential growth
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Unit 3
Unit 3Unit 3
Unit 3
 
Exercise #19
Exercise #19Exercise #19
Exercise #19
 
Lecture 1: basic syntax
Lecture 1: basic syntaxLecture 1: basic syntax
Lecture 1: basic syntax
 
Taller cálculo diferencial
Taller cálculo diferencialTaller cálculo diferencial
Taller cálculo diferencial
 
Graphing Absolute Value
Graphing Absolute ValueGraphing Absolute Value
Graphing Absolute Value
 
3.3 graphs of exponential functions
3.3 graphs of  exponential functions3.3 graphs of  exponential functions
3.3 graphs of exponential functions
 
Pre-Cal 30S January 19, 2009
Pre-Cal 30S January 19, 2009Pre-Cal 30S January 19, 2009
Pre-Cal 30S January 19, 2009
 
Xmss ict lesson sec 2 qe wksheet
Xmss  ict lesson sec 2 qe wksheetXmss  ict lesson sec 2 qe wksheet
Xmss ict lesson sec 2 qe wksheet
 
7 2 Graphing Simple Quadratic Functions
7 2 Graphing Simple Quadratic Functions7 2 Graphing Simple Quadratic Functions
7 2 Graphing Simple Quadratic Functions
 
7th PreAlg - Lesson 41--Dec16
7th PreAlg - Lesson 41--Dec167th PreAlg - Lesson 41--Dec16
7th PreAlg - Lesson 41--Dec16
 
QR 1 Lesson Notes 8 - Motivation for Modelling with Linear Functions PP Show
QR 1 Lesson Notes 8 - Motivation for Modelling with Linear Functions PP ShowQR 1 Lesson Notes 8 - Motivation for Modelling with Linear Functions PP Show
QR 1 Lesson Notes 8 - Motivation for Modelling with Linear Functions PP Show
 
Generate and test random numbers
Generate and test random numbersGenerate and test random numbers
Generate and test random numbers
 
5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!
 

Viewers also liked

Viewers also liked (11)

Naive Bayes | Statistics
Naive Bayes | StatisticsNaive Bayes | Statistics
Naive Bayes | Statistics
 
Easy to use Fuzzy of Matlab
Easy to use Fuzzy of  Matlab  Easy to use Fuzzy of  Matlab
Easy to use Fuzzy of Matlab
 
Quantative analysis
Quantative analysisQuantative analysis
Quantative analysis
 
Bioinformatics Analysis of Nucleotide Sequences
Bioinformatics Analysis of Nucleotide SequencesBioinformatics Analysis of Nucleotide Sequences
Bioinformatics Analysis of Nucleotide Sequences
 
Basic statistics
Basic statisticsBasic statistics
Basic statistics
 
Statistics for data scientists
Statistics for  data scientistsStatistics for  data scientists
Statistics for data scientists
 
PPT (2)
PPT (2)PPT (2)
PPT (2)
 
Role of Statistics in Scientific Research
Role of Statistics in Scientific ResearchRole of Statistics in Scientific Research
Role of Statistics in Scientific Research
 
Noise Models
Noise ModelsNoise Models
Noise Models
 
Statistics
StatisticsStatistics
Statistics
 
SPSS statistics - get help using SPSS
SPSS statistics - get help using SPSSSPSS statistics - get help using SPSS
SPSS statistics - get help using SPSS
 

Similar to Introduction matlab

Ning_Mei.ASSIGN02
Ning_Mei.ASSIGN02Ning_Mei.ASSIGN02
Ning_Mei.ASSIGN02宁 梅
 
Machine learning
Machine learningMachine learning
Machine learningShreyas G S
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingDr. Manjunatha. P
 
Accelerating Metropolis Hastings with Lightweight Inference Compilation
Accelerating Metropolis Hastings with Lightweight Inference CompilationAccelerating Metropolis Hastings with Lightweight Inference Compilation
Accelerating Metropolis Hastings with Lightweight Inference CompilationFeynman Liang
 
Csci101 lect02 selection_andlooping
Csci101 lect02 selection_andloopingCsci101 lect02 selection_andlooping
Csci101 lect02 selection_andloopingElsayed Hemayed
 
Programming withmatlab
Programming withmatlabProgramming withmatlab
Programming withmatlabnehanairm
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013amanabr
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Kurmendra Singh
 
Introducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowIntroducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowEtsuji Nakai
 

Similar to Introduction matlab (20)

3_MLE_printable.pdf
3_MLE_printable.pdf3_MLE_printable.pdf
3_MLE_printable.pdf
 
201977 1-1-4-pb
201977 1-1-4-pb201977 1-1-4-pb
201977 1-1-4-pb
 
Ning_Mei.ASSIGN02
Ning_Mei.ASSIGN02Ning_Mei.ASSIGN02
Ning_Mei.ASSIGN02
 
E10
E10E10
E10
 
Bayesian_Decision_Theory-3.pdf
Bayesian_Decision_Theory-3.pdfBayesian_Decision_Theory-3.pdf
Bayesian_Decision_Theory-3.pdf
 
Machine learning
Machine learningMachine learning
Machine learning
 
Statistics Assignment Help
Statistics Assignment HelpStatistics Assignment Help
Statistics Assignment Help
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
 
A basic introduction to learning
A basic introduction to learningA basic introduction to learning
A basic introduction to learning
 
Accelerating Metropolis Hastings with Lightweight Inference Compilation
Accelerating Metropolis Hastings with Lightweight Inference CompilationAccelerating Metropolis Hastings with Lightweight Inference Compilation
Accelerating Metropolis Hastings with Lightweight Inference Compilation
 
Functions lesson
Functions lesson Functions lesson
Functions lesson
 
Csci101 lect02 selection_andlooping
Csci101 lect02 selection_andloopingCsci101 lect02 selection_andlooping
Csci101 lect02 selection_andlooping
 
Programming withmatlab
Programming withmatlabProgramming withmatlab
Programming withmatlab
 
working with python
working with pythonworking with python
working with python
 
Numerical Computation
Numerical ComputationNumerical Computation
Numerical Computation
 
Glm
GlmGlm
Glm
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Introducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowIntroducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlow
 
Probability Cheatsheet.pdf
Probability Cheatsheet.pdfProbability Cheatsheet.pdf
Probability Cheatsheet.pdf
 

Recently uploaded

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Introduction matlab

  • 1. Plotting in Matlab and Fuzzy Logic Toolbox -------An Introduction
  • 2. PLOT (2-D plotting)  Linear plot.  PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix, then the vector is plotted versus the rows or columns of the matrix, whichever line up. If X is a scalar and Y is a vector, length(Y) disconnected points are plotted.  PLOT(Y) plots the columns of Y versus their index. If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)). In all other uses of PLOT, the imaginary part is ignored.
  • 3. Line plot x = 0 : 0.05 : 5; y = sin(x .^ 2); plot(x, y);
  • 4. Other 2-D plotting  bar  stairs  errorbar  polar  stem
  • 5. MESH (3-D plotting) % Mesh Plot of Peaks z=peaks(25); mesh(z);
  • 6. Other 3-D plotting  surf  surfl  contour  quiver  slice
  • 7. Example Membership Function of “young” Filename: mfyoung.m function y = mfyoung(x) % member function: young y = exp(-power(x/20,2)); 2 20       − = x young ey
  • 8. Membership Function of “old” Filename: mfold.m function y = mfold(x) % member function: old y = exp(-power((x-100)/30,2)); 2 30 100       − − = x old ey
  • 9. 2 oldveryold yy = 2 youngveryyoung yy = ( )veryoldveryyoungveryoldnotandveryyoungnot yyy ,min____ = ( )veryoldveryyoungveryoldorveryyoung yyy ,max__ =
  • 10. x = 0:1:100; % people age between 0 and 100. y=min((1-power(mfyoung(x), 2)),(1-power(mfold(x), 2))); % not very young and not very old. plot(x,y) y=max(power(mfyoung(x), 2), power(mfold(x), 2)); % very young or very old figure, plot(x,y) % open a new figure window and plot
  • 11.
  • 12. Fuzzy Logic Toolbox (GUI)  Start the toolbox:
  • 16. Command Line functions  plotfis  plotmf  gensurf
  • 18. Building a FIS from scratch  The Basic Tipping Problem. Given a number between 0 and 10 that represents the quality of service at a restaurant (where 10 is excellent), and another number between 0 and 10 that represents the quality of the food at that restaurant (again, 10 is excellent), what should the tip be?
  • 19. Building a FIS from scratch (cont.) – 1. If the service is poor or the food is rancid, then tip is cheap. – 2. If the service is good, then tip is average. – 3. If the service is excellent or the food is delicious, then tip is generous. – We'll assume that an average tip is 15%, a generous tip is 25%, and a cheap tip is 5%. It's also useful to have a vague idea of what the tipping function should look like.