• Save
Matlab: Programming Environment
Upcoming SlideShare
Loading in...5
×
 

Matlab: Programming Environment

on

  • 1,508 views

Matlab: Programming Environment

Matlab: Programming Environment

Statistics

Views

Total Views
1,508
Views on SlideShare
1,481
Embed Views
27

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 27

http://www.dataminingtools.net 20
http://dataminingtools.net 7

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Matlab: Programming Environment Matlab: Programming Environment Presentation Transcript

    • 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