SlideShare a Scribd company logo
Matlab: Programming Environment
Your first runSection 1: The toolbar is where you can access the various features, tools and options regarding your code, debugging process, formatting, etc
Your first runSection 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 runSection 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 runSection 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 runSection 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 HelpMATLAB 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 HelpExplore 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 FunctionsMatlab 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 FunctionsAlmost 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 FunctionsTo 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 FunctionsTo 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 tutorialsPick 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

More Related Content

PPTX
Matlab Programming Tips Part 1
PPTX
Matlab introduction
PPTX
An Introduction to MATLAB for beginners
PPT
How to work on Matlab.......
PPTX
Matlab for diploma students(1)
PPT
Brief Introduction to Matlab
DOCX
MATLAB BASICS
PDF
Matlab programming project
Matlab Programming Tips Part 1
Matlab introduction
An Introduction to MATLAB for beginners
How to work on Matlab.......
Matlab for diploma students(1)
Brief Introduction to Matlab
MATLAB BASICS
Matlab programming project

What's hot (20)

PDF
Matlab Tutorial for Beginners - I
PPTX
Procedures And Functions in Matlab
PPTX
Matlab 1(operations on_matrix)
PPSX
Matlab basic and image
PPT
Matlab Basic Tutorial
PPTX
Introduction to MATLAB
PPTX
Introduction to Matlab Scripts
PDF
MATLAB Programming
PPTX
Matlab m files and scripts
PPT
Basics of programming in matlab
DOC
Matlab summary
PDF
Matlab introduction lecture 1
PPT
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
PPTX
C,C++ In Matlab
PPTX
MATLAB Scripts - Examples
DOC
Matlab tut2
PPT
Matlab anilkumar
PPTX
Introduction to matlab lecture 1 of 4
PPTX
Basic matlab and matrix
PPT
Introduction to matlab
Matlab Tutorial for Beginners - I
Procedures And Functions in Matlab
Matlab 1(operations on_matrix)
Matlab basic and image
Matlab Basic Tutorial
Introduction to MATLAB
Introduction to Matlab Scripts
MATLAB Programming
Matlab m files and scripts
Basics of programming in matlab
Matlab summary
Matlab introduction lecture 1
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
C,C++ In Matlab
MATLAB Scripts - Examples
Matlab tut2
Matlab anilkumar
Introduction to matlab lecture 1 of 4
Basic matlab and matrix
Introduction to matlab
Ad

Similar to Matlab: Programming Environment (20)

PDF
Malab tutorial
PPT
Matlab Tutorial.ppt
PPT
Matlab Introduction
PPTX
Introduction to scientific computing with matlab.pptx
PDF
An Introduction to MATLAB with Worked Examples
PDF
Basic matlab for beginners
PDF
MATLAB INTRODUCTION
PPT
Matlab basics
DOCX
Introduction to matlab
PPTX
MATLAB for Engineers ME1006 (1 for beginer).pptx
PPT
Matlab Overviiew
PPTX
Chap#0_Introducation_to_nsnsnnMATLAB.pptx
PPT
matlab_tutorial.ppt
PPT
matlab_tutorial.ppt
PPT
matlab_tutorial.ppt
PDF
Matlab guide
PDF
Introduction to matlab
PPTX
From zero to MATLAB hero: Mastering the basics and beyond
PPT
matlab tutorial with separate function description and handson learning
PDF
Matlab brochure
Malab tutorial
Matlab Tutorial.ppt
Matlab Introduction
Introduction to scientific computing with matlab.pptx
An Introduction to MATLAB with Worked Examples
Basic matlab for beginners
MATLAB INTRODUCTION
Matlab basics
Introduction to matlab
MATLAB for Engineers ME1006 (1 for beginer).pptx
Matlab Overviiew
Chap#0_Introducation_to_nsnsnnMATLAB.pptx
matlab_tutorial.ppt
matlab_tutorial.ppt
matlab_tutorial.ppt
Matlab guide
Introduction to matlab
From zero to MATLAB hero: Mastering the basics and beyond
matlab tutorial with separate function description and handson learning
Matlab brochure
Ad

More from matlab Content (20)

PPTX
C,C++ In Matlab
PPTX
Matlab: Control Statements
PPTX
Matlab: Discrete Linear Systems
PPTX
Matlab Distributions
PPTX
Matlab: Graph Plots
PPTX
Matlab: Gui
PPTX
Matlab: Linear Methods, Quantiles
PPTX
Matlab Data And Statistics
PPTX
Matlab Feature Extraction Using Segmentation And Edge Detection
PPTX
Matlab Image Enhancement Techniques
PPTX
Matlab Image Restoration Techniques
PPTX
Matlab Importing Data
PPTX
Matlab Organizing Data
PPTX
Matlab Text Files
PPTX
Matlab Visualizing Data
PPTX
Matlab Working With Images
PPTX
Matlab: Non Linear Methods
PPTX
Matlab: Procedures And Functions
PPTX
Matlab: Regression
PPTX
Matlab: Saving And Publishing
C,C++ In Matlab
Matlab: Control Statements
Matlab: Discrete Linear Systems
Matlab Distributions
Matlab: Graph Plots
Matlab: Gui
Matlab: Linear Methods, Quantiles
Matlab Data And Statistics
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Image Enhancement Techniques
Matlab Image Restoration Techniques
Matlab Importing Data
Matlab Organizing Data
Matlab Text Files
Matlab Visualizing Data
Matlab Working With Images
Matlab: Non Linear Methods
Matlab: Procedures And Functions
Matlab: Regression
Matlab: Saving And Publishing

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
cuic standard and advanced reporting.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Machine Learning_overview_presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
cuic standard and advanced reporting.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine Learning_overview_presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation theory and applications.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Review of recent advances in non-invasive hemoglobin estimation

Matlab: Programming Environment

  • 2. Your first runSection 1: The toolbar is where you can access the various features, tools and options regarding your code, debugging process, formatting, etc
  • 3. Your first runSection 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 runSection 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 runSection 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 runSection 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 HelpMATLAB 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 HelpExplore 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 FunctionsMatlab 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 FunctionsAlmost 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 FunctionsTo 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 FunctionsTo 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 tutorialsPick 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