SlideShare una empresa de Scribd logo
1 de 17
Matlab: Programming Environment
Your first run Section 1: The toolbar is where you can access the various features, tools and options regarding your code, debugging process, formatting, etc
Your first run Section 2: The file-manager shows your current directory and the files in it. You can change the directory by double clicking any folder or using the drop-down menu at the top.
Your first run Section 3: The command window is the place from where you tell MATLAB what is to be done! You have the option of either writing commands directly or running a 'MATLAB' file (with the extension .m) which would consist of commands, functions or programs.
Your first run Section 4: When you write a new program or type in some commands, you would almost always, use variables to store the values obtained. The workspace shows you all your current variables and their values and allows you to edit, copy or duplicate them.
Your first run Section 5: The command history window saves your recent commands and helps you in keeping a track of what you have been up to!  It comes out quite handy when you have to use long commands repeatedly: Simply double click on that command in the command history window and it will start running!
MATLAB Help MATLAB provides an excellent documentation of all its toolboxes and their respective commands. It also includes sample codes and examples! Go to the Help option and MATLAB and click on 'Product Help'(or simply press F1).
MATLAB Help Explore the Help contents and you would find loads of useful things. Here is a snapshot of the first example in Image Processing toolbox. It teaches how to read and display an image.
Function Browser: a quick search tool! Click on 'Help' on the toolbar and go to 'Function Browser' (or press Shift+F1). This is what will pop up:
Function Browser: a quick search tool! The 'Function Browser', as the name suggests, is a quick search tool for description and synopsis of commands and functions of MATLAB. In the figure towards the right, I have searched for 'contrast' and it lists all the functions and commands related to that keyword.  It gives concise information about the function you are looking for.
Basic Functions Matlab allows us to define (and evaluate) our own functions as well. For example, lets define a function f(x)=x2+1. To do this, we simply type in f=x.^2+1. Since x has a value of 10, the answer is 101. We can now change the value of x. For example, type x=5 and enter, then type f=x.^2+1 again. We should now get 26.
Basic Functions Almost all of Matlab's basic commands revolve around the use of vectors. A vector is defined by placing a sequence of numbers within square braces: >> v = [3 1]  v = 3   1
Basic Functions To view the vector just type its label: >> v  		v =    3      1  >> v = [3 1 7 -21 5 6] 	 v =    3    1     7    -21    5     6
Basic Functions To define a matrix, we can treat it like a column of row vectors (note that the spaces are required!): >> A = [ 1 2 3; 3 4 5; 6 7 8]  A = 	1	 2 	3  		3 	4 	5  		6 	7 	8
Basic Functions  the whoscommand will let you know all of the variables you have in your work space. >> whos  Name 	Size	 Bytes 	Class  A 		3x3 	72 	double array  B 		3x3 	72	 double array  v 		1x5 	40	 double array  Grand total is 23 elements using 184 bytes
Basic Functions  Sometimes you would like to clear all of your data and start over.  You do this with the "clear" command.  >> clear  >> whos
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

Más contenido relacionado

La actualidad más candente

Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IVijay Kumar Gupta
 
Procedures And Functions in Matlab
Procedures And Functions in MatlabProcedures And Functions in Matlab
Procedures And Functions in MatlabDataminingTools Inc
 
Matlab 1(operations on_matrix)
Matlab 1(operations on_matrix)Matlab 1(operations on_matrix)
Matlab 1(operations on_matrix)harman kaur
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLABRavikiran A
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab ScriptsShameer Ahmed Koya
 
Matlab m files and scripts
Matlab m files and scriptsMatlab m files and scripts
Matlab m files and scriptsAmeen San
 
Basics of programming in matlab
Basics of programming in matlabBasics of programming in matlab
Basics of programming in matlabAKANKSHA GUPTA
 
Matlab introduction lecture 1
Matlab introduction lecture 1Matlab introduction lecture 1
Matlab introduction lecture 1Mohamed Awni
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkreddyprasad reddyvari
 
Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4Randa Elanwar
 
Basic matlab and matrix
Basic matlab and matrixBasic matlab and matrix
Basic matlab and matrixSaidur Rahman
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabBilawalBaloch1
 

La actualidad más candente (20)

Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - I
 
Procedures And Functions in Matlab
Procedures And Functions in MatlabProcedures And Functions in Matlab
Procedures And Functions in Matlab
 
Matlab 1(operations on_matrix)
Matlab 1(operations on_matrix)Matlab 1(operations on_matrix)
Matlab 1(operations on_matrix)
 
Matlab basic and image
Matlab basic and imageMatlab basic and image
Matlab basic and image
 
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 Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab Scripts
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
Matlab m files and scripts
Matlab m files and scriptsMatlab m files and scripts
Matlab m files and scripts
 
Basics of programming in matlab
Basics of programming in matlabBasics of programming in matlab
Basics of programming in matlab
 
Matlab summary
Matlab summaryMatlab summary
Matlab summary
 
Matlab introduction lecture 1
Matlab introduction lecture 1Matlab introduction lecture 1
Matlab introduction lecture 1
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
 
C,C++ In Matlab
C,C++ In MatlabC,C++ In Matlab
C,C++ In Matlab
 
MATLAB Scripts - Examples
MATLAB Scripts - ExamplesMATLAB Scripts - Examples
MATLAB Scripts - Examples
 
Matlab tut2
Matlab tut2Matlab tut2
Matlab tut2
 
Matlab anilkumar
Matlab  anilkumarMatlab  anilkumar
Matlab anilkumar
 
Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4
 
Basic matlab and matrix
Basic matlab and matrixBasic matlab and matrix
Basic matlab and matrix
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 

Similar a Matlab: Programming Environment

Similar a Matlab: Programming Environment (20)

EE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manualEE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manual
 
Matlab guide
Matlab guideMatlab guide
Matlab guide
 
Basic matlab for beginners
Basic matlab for beginnersBasic matlab for beginners
Basic matlab for beginners
 
Matlab 1 level_1
Matlab 1 level_1Matlab 1 level_1
Matlab 1 level_1
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
From zero to MATLAB hero: Mastering the basics and beyond
From zero to MATLAB hero: Mastering the basics and beyondFrom zero to MATLAB hero: Mastering the basics and beyond
From zero to MATLAB hero: Mastering the basics and beyond
 
Ch1
Ch1Ch1
Ch1
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
MATLAB Basics-Part1
MATLAB Basics-Part1MATLAB Basics-Part1
MATLAB Basics-Part1
 
matlabchapter1.ppt
matlabchapter1.pptmatlabchapter1.ppt
matlabchapter1.ppt
 
MATLAB INTRODUCTION
MATLAB INTRODUCTIONMATLAB INTRODUCTION
MATLAB INTRODUCTION
 
Kevin merchantss
Kevin merchantssKevin merchantss
Kevin merchantss
 
KEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENTKEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENT
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
Introduction to Matlab for Engineering Students.pdf
Introduction to Matlab for Engineering Students.pdfIntroduction to Matlab for Engineering Students.pdf
Introduction to Matlab for Engineering Students.pdf
 
Curve fitting
Curve fittingCurve fitting
Curve fitting
 
Palm m3 chapter1b
Palm m3 chapter1bPalm m3 chapter1b
Palm m3 chapter1b
 
Matlab Manual
Matlab ManualMatlab Manual
Matlab Manual
 
Matlab
MatlabMatlab
Matlab
 
Tutorials on Macro
Tutorials on MacroTutorials on Macro
Tutorials on Macro
 

Más 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: Procedures And Functions
Matlab: Procedures And FunctionsMatlab: Procedures And Functions
Matlab: Procedures And Functionsmatlab Content
 
Matlab: Saving And Publishing
Matlab: Saving And PublishingMatlab: Saving And Publishing
Matlab: Saving And Publishingmatlab Content
 

Más 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: Procedures And Functions
Matlab: Procedures And FunctionsMatlab: Procedures And Functions
Matlab: Procedures And Functions
 
Matlab: Regression
Matlab: RegressionMatlab: Regression
Matlab: Regression
 
Matlab: Saving And Publishing
Matlab: Saving And PublishingMatlab: Saving And Publishing
Matlab: Saving And Publishing
 

Último

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
[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
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
[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
 

Matlab: Programming Environment

  • 2. Your first run Section 1: The toolbar is where you can access the various features, tools and options regarding your code, debugging process, formatting, etc
  • 3. Your first run Section 2: The file-manager shows your current directory and the files in it. You can change the directory by double clicking any folder or using the drop-down menu at the top.
  • 4. Your first run Section 3: The command window is the place from where you tell MATLAB what is to be done! You have the option of either writing commands directly or running a 'MATLAB' file (with the extension .m) which would consist of commands, functions or programs.
  • 5. Your first run Section 4: When you write a new program or type in some commands, you would almost always, use variables to store the values obtained. The workspace shows you all your current variables and their values and allows you to edit, copy or duplicate them.
  • 6. Your first run Section 5: The command history window saves your recent commands and helps you in keeping a track of what you have been up to! It comes out quite handy when you have to use long commands repeatedly: Simply double click on that command in the command history window and it will start running!
  • 7. MATLAB Help MATLAB provides an excellent documentation of all its toolboxes and their respective commands. It also includes sample codes and examples! Go to the Help option and MATLAB and click on 'Product Help'(or simply press F1).
  • 8. MATLAB Help Explore the Help contents and you would find loads of useful things. Here is a snapshot of the first example in Image Processing toolbox. It teaches how to read and display an image.
  • 9. Function Browser: a quick search tool! Click on 'Help' on the toolbar and go to 'Function Browser' (or press Shift+F1). This is what will pop up:
  • 10. Function Browser: a quick search tool! The 'Function Browser', as the name suggests, is a quick search tool for description and synopsis of commands and functions of MATLAB. In the figure towards the right, I have searched for 'contrast' and it lists all the functions and commands related to that keyword. It gives concise information about the function you are looking for.
  • 11. Basic Functions Matlab allows us to define (and evaluate) our own functions as well. For example, lets define a function f(x)=x2+1. To do this, we simply type in f=x.^2+1. Since x has a value of 10, the answer is 101. We can now change the value of x. For example, type x=5 and enter, then type f=x.^2+1 again. We should now get 26.
  • 12. Basic Functions Almost all of Matlab's basic commands revolve around the use of vectors. A vector is defined by placing a sequence of numbers within square braces: >> v = [3 1] v = 3 1
  • 13. Basic Functions To view the vector just type its label: >> v v = 3 1 >> v = [3 1 7 -21 5 6] v = 3 1 7 -21 5 6
  • 14. Basic Functions To define a matrix, we can treat it like a column of row vectors (note that the spaces are required!): >> A = [ 1 2 3; 3 4 5; 6 7 8] A = 1 2 3 3 4 5 6 7 8
  • 15. Basic Functions  the whoscommand will let you know all of the variables you have in your work space. >> whos Name Size Bytes Class A 3x3 72 double array B 3x3 72 double array v 1x5 40 double array Grand total is 23 elements using 184 bytes
  • 16. Basic Functions  Sometimes you would like to clear all of your data and start over. You do this with the "clear" command. >> clear >> whos
  • 17. 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