SlideShare uma empresa Scribd logo
1 de 16
Matlab: Procedures and Functions
Script files Script files, also called M- files as they have extension .m, make MATLAB programming much more efficient than entering individual commands at the command prompt. A script file consists of MATLAB commands that together perform a specific task. The M-file is a text file which can be created and edited by any plain text editor like Notepad, emacs or the built-in MATLAB editor. 
Script files Script files, also called M- files as they have extension .m, make MATLAB programming much more efficient than entering individual commands at the command prompt. A script file consists of MATLAB commands that together perform a specific task. The M-file is a text file which can be created and edited by any plain text editor like Notepad, emacs or the built-in MATLAB editor. 
Script files Here’s an example of what a script file looks like:
Script files Important commands: for- To print "Hello World" 10 times write ,[object Object]
disp('Hello World')
 end,[object Object]
a = b + 1
elseif a > b
 a = b - 1
else a = b
 end,[object Object]
 User Defined Functions An example of a function:
String Handling Creating strings Strings are matrices with character elements. The simplest way to create a string is to use it on the left side of an equal sign where the right side of the equal sign is an expression that evaluates to a string. String constants (literals) are enclosed in single quotes. The following example shows how to create string variables. >> first = 'John';  >> last = 'Coltrane';  >> name = [first,' ',last]
String Handling >> string='This is a string‘ >> string(3) % gives the third element in the variable words.  ans = i >> string(2)='t' % replaces the second element in the vector with t.
String Handling >> Y= input('Please type something here: ','s');  % Matlab expects a  number, string or a matrix from the keyboard.  % The second argument says the returned variable should be a string. >> disp('The name is: '), disp(x)  % gives text as output and the value of x.

Mais conteúdo relacionado

Mais procurados (20)

MIMO OFDM
MIMO OFDMMIMO OFDM
MIMO OFDM
 
4.5 equalizers and its types
4.5   equalizers and its types4.5   equalizers and its types
4.5 equalizers and its types
 
BJT Tuned amplifiers
BJT Tuned amplifiersBJT Tuned amplifiers
BJT Tuned amplifiers
 
DPCM
DPCMDPCM
DPCM
 
Digital modulation techniques...
Digital modulation techniques...Digital modulation techniques...
Digital modulation techniques...
 
parametric method of power spectrum Estimation
parametric method of power spectrum Estimationparametric method of power spectrum Estimation
parametric method of power spectrum Estimation
 
Modulation Techniques for Mobile Radio
Modulation Techniques for Mobile RadioModulation Techniques for Mobile Radio
Modulation Techniques for Mobile Radio
 
Ch12
Ch12Ch12
Ch12
 
Modulation techniques
Modulation techniquesModulation techniques
Modulation techniques
 
Channel Model.pptx
Channel Model.pptxChannel Model.pptx
Channel Model.pptx
 
Voltage Regulators ppt
Voltage Regulators pptVoltage Regulators ppt
Voltage Regulators ppt
 
Internet stack protocol
Internet stack protocolInternet stack protocol
Internet stack protocol
 
Ece523 folded cascode design
Ece523 folded cascode designEce523 folded cascode design
Ece523 folded cascode design
 
M ary psk modulation
M ary psk modulationM ary psk modulation
M ary psk modulation
 
Power amplifier
Power amplifierPower amplifier
Power amplifier
 
Pn sequence
Pn sequencePn sequence
Pn sequence
 
Chapter 6m
Chapter 6mChapter 6m
Chapter 6m
 
Two cavity klystron
Two cavity klystronTwo cavity klystron
Two cavity klystron
 
Voltage regulators
Voltage regulatorsVoltage regulators
Voltage regulators
 
LICA- DIFFERENTIAL APLIFIERS
LICA- DIFFERENTIAL APLIFIERSLICA- DIFFERENTIAL APLIFIERS
LICA- DIFFERENTIAL APLIFIERS
 

Destaque

Matlab Introduction
Matlab IntroductionMatlab Introduction
Matlab Introductionideas2ignite
 
Matlab assignment help
Matlab assignment helpMatlab assignment help
Matlab assignment helpAnderson Silva
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab ScriptsShameer Ahmed Koya
 
Journal Club - Best Practices for Scientific Computing
Journal Club - Best Practices for Scientific ComputingJournal Club - Best Practices for Scientific Computing
Journal Club - Best Practices for Scientific ComputingBram Zandbelt
 
How to work on Matlab.......
How to work on Matlab.......How to work on Matlab.......
How to work on Matlab.......biinoida
 

Destaque (6)

Matlab Introduction
Matlab IntroductionMatlab Introduction
Matlab Introduction
 
Matlab assignment help
Matlab assignment helpMatlab assignment help
Matlab assignment help
 
MATLAB Scripts - Examples
MATLAB Scripts - ExamplesMATLAB Scripts - Examples
MATLAB Scripts - Examples
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab Scripts
 
Journal Club - Best Practices for Scientific Computing
Journal Club - Best Practices for Scientific ComputingJournal Club - Best Practices for Scientific Computing
Journal Club - Best Practices for Scientific Computing
 
How to work on Matlab.......
How to work on Matlab.......How to work on Matlab.......
How to work on Matlab.......
 

Semelhante a Matlab: Procedures And Functions

Semelhante a Matlab: Procedures And Functions (20)

Matlab Basic Tutorial
Matlab Basic TutorialMatlab Basic Tutorial
Matlab Basic Tutorial
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Matlab Manual
Matlab ManualMatlab Manual
Matlab Manual
 
Brief Introduction to Matlab
Brief  Introduction to MatlabBrief  Introduction to Matlab
Brief Introduction to Matlab
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
Matlab strings
Matlab stringsMatlab strings
Matlab strings
 
Pattern matching programs
Pattern matching programsPattern matching programs
Pattern matching programs
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Ch1
Ch1Ch1
Ch1
 
Unitii classnotes
Unitii classnotesUnitii classnotes
Unitii classnotes
 
Ch09
Ch09Ch09
Ch09
 
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
 
Matlab guide
Matlab guideMatlab guide
Matlab guide
 

Mais de matlab Content

Matlab: Control Statements
Matlab: Control StatementsMatlab: Control Statements
Matlab: Control Statementsmatlab Content
 
Matlab: Discrete Linear Systems
Matlab: Discrete Linear SystemsMatlab: Discrete Linear Systems
Matlab: Discrete Linear Systemsmatlab Content
 
Matlab: Linear Methods, Quantiles
Matlab: Linear Methods, QuantilesMatlab: Linear Methods, Quantiles
Matlab: Linear Methods, Quantilesmatlab Content
 
Matlab Data And Statistics
Matlab Data And StatisticsMatlab Data And Statistics
Matlab Data And Statisticsmatlab Content
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge Detectionmatlab Content
 
Matlab Image Enhancement Techniques
Matlab Image Enhancement TechniquesMatlab Image Enhancement Techniques
Matlab Image Enhancement Techniquesmatlab Content
 
Matlab Image Restoration Techniques
Matlab Image Restoration TechniquesMatlab Image Restoration Techniques
Matlab Image Restoration Techniquesmatlab Content
 
Matlab Organizing Data
Matlab Organizing DataMatlab Organizing Data
Matlab Organizing Datamatlab Content
 
Matlab Visualizing Data
Matlab Visualizing DataMatlab Visualizing Data
Matlab Visualizing Datamatlab Content
 
Matlab Working With Images
Matlab Working With ImagesMatlab Working With Images
Matlab Working With Imagesmatlab Content
 
Matlab: Non Linear Methods
Matlab: Non Linear MethodsMatlab: Non Linear Methods
Matlab: Non Linear Methodsmatlab Content
 
Matlab: Programming Environment
Matlab: Programming EnvironmentMatlab: Programming Environment
Matlab: Programming Environmentmatlab Content
 
Matlab: Saving And Publishing
Matlab: Saving And PublishingMatlab: Saving And Publishing
Matlab: Saving And Publishingmatlab Content
 

Mais de matlab Content (20)

C,C++ In Matlab
C,C++ In MatlabC,C++ In Matlab
C,C++ In Matlab
 
Matlab: Control Statements
Matlab: Control StatementsMatlab: Control Statements
Matlab: Control Statements
 
Matlab: Discrete Linear Systems
Matlab: Discrete Linear SystemsMatlab: Discrete Linear Systems
Matlab: Discrete Linear Systems
 
Matlab Distributions
Matlab DistributionsMatlab Distributions
Matlab Distributions
 
Matlab: Graph Plots
Matlab: Graph PlotsMatlab: Graph Plots
Matlab: Graph Plots
 
Matlab: Gui
Matlab: GuiMatlab: Gui
Matlab: Gui
 
Matlab: Linear Methods, Quantiles
Matlab: Linear Methods, QuantilesMatlab: Linear Methods, Quantiles
Matlab: Linear Methods, Quantiles
 
Matlab Data And Statistics
Matlab Data And StatisticsMatlab Data And Statistics
Matlab Data And Statistics
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge Detection
 
Matlab Image Enhancement Techniques
Matlab Image Enhancement TechniquesMatlab Image Enhancement Techniques
Matlab Image Enhancement Techniques
 
Matlab Image Restoration Techniques
Matlab Image Restoration TechniquesMatlab Image Restoration Techniques
Matlab Image Restoration Techniques
 
Matlab Importing Data
Matlab Importing DataMatlab Importing Data
Matlab Importing Data
 
Matlab Organizing Data
Matlab Organizing DataMatlab Organizing Data
Matlab Organizing Data
 
Matlab Text Files
Matlab Text FilesMatlab Text Files
Matlab Text Files
 
Matlab Visualizing Data
Matlab Visualizing DataMatlab Visualizing Data
Matlab Visualizing Data
 
Matlab Working With Images
Matlab Working With ImagesMatlab Working With Images
Matlab Working With Images
 
Matlab: Non Linear Methods
Matlab: Non Linear MethodsMatlab: Non Linear Methods
Matlab: Non Linear Methods
 
Matlab: Programming Environment
Matlab: Programming EnvironmentMatlab: Programming Environment
Matlab: Programming Environment
 
Matlab: Regression
Matlab: RegressionMatlab: Regression
Matlab: Regression
 
Matlab: Saving And Publishing
Matlab: Saving And PublishingMatlab: Saving And Publishing
Matlab: Saving And Publishing
 

Último

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
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...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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?
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Matlab: Procedures And Functions

  • 2. Script files Script files, also called M- files as they have extension .m, make MATLAB programming much more efficient than entering individual commands at the command prompt. A script file consists of MATLAB commands that together perform a specific task. The M-file is a text file which can be created and edited by any plain text editor like Notepad, emacs or the built-in MATLAB editor. 
  • 3. Script files Script files, also called M- files as they have extension .m, make MATLAB programming much more efficient than entering individual commands at the command prompt. A script file consists of MATLAB commands that together perform a specific task. The M-file is a text file which can be created and edited by any plain text editor like Notepad, emacs or the built-in MATLAB editor. 
  • 4. Script files Here’s an example of what a script file looks like:
  • 5.
  • 7.
  • 8. a = b + 1
  • 10. a = b - 1
  • 12.
  • 13. User Defined Functions An example of a function:
  • 14. String Handling Creating strings Strings are matrices with character elements. The simplest way to create a string is to use it on the left side of an equal sign where the right side of the equal sign is an expression that evaluates to a string. String constants (literals) are enclosed in single quotes. The following example shows how to create string variables. >> first = 'John'; >> last = 'Coltrane'; >> name = [first,' ',last]
  • 15. String Handling >> string='This is a string‘ >> string(3) % gives the third element in the variable words. ans = i >> string(2)='t' % replaces the second element in the vector with t.
  • 16. String Handling >> Y= input('Please type something here: ','s'); % Matlab expects a number, string or a matrix from the keyboard. % The second argument says the returned variable should be a string. >> disp('The name is: '), disp(x) % gives text as output and the value of x.
  • 17. String Handling Also, different formats can be converted to ‘strings’ and vice verse. Here are some examples of functions that help in converting between different formats: int2str(n)  Converts an integer n to a string hex2num(hstr)  Converts hexadecimal number hstr to a float. hex2dec(hstr)  Converts hexadecimal string to decimal integer. dec2hex(n)  Converts decimal integer to hexadecimal string. bin2dec(str)  Converts binary string to decimal integer. mat2str(A,n)  Convert a 2-D matrix to a string in MATLAB syntax.
  • 18. String Handling There are several functions available to manipulate or fetch appropriate data from strings: blanks(n)  Gives a string with n blanks deblank(str)  Subtracts all blanks at the end of the string. lower(str)  All letters are changed to small. upper(str)  All letters are changed to capital. ischar(str)  If string contains character => gives 1 in return, 0 otherwise.
  • 19. String Handling There are several functions available to manipulate or fetch appropriate data from strings: isletter(str(i))  If element number i in the string is a letter=> gives one in return. isspace(str)  True for white space characters. strcmp(str1,str2)  returns 1 if strings S1 and S2 are the same and 0 otherwise. strcmpi(str1,str2)  returns 1 if strings S1 and S2 are the same except forcase and 0 otherwise.
  • 20. String Handling There are several functions available to manipulate or fetch appropriate data from strings: strfind(str1,str2)  returns the starting indices of any occurrences of the string str2 in the string str1. findstr(str1,str2)  returns the starting indices of any occurrences of the shorter of the two strings in the longer.
  • 21. Visit more self help tutorials Pick a tutorial of your choice and browse through it at your own pace. The tutorials section is free, self-guiding and will not involve any additional support. Visit us at www.dataminingtools.net