Presentation is loading. Please wait.

Presentation is loading. Please wait.

Release Numbers MATLAB is updated regularly

Similar presentations


Presentation on theme: "Release Numbers MATLAB is updated regularly"— Presentation transcript:

1 Release Numbers MATLAB is updated regularly
The Mathworks packages their software in groups, called releases, New releases are issued twice a year in the spring and in the fall Release 2013a includes MATLAB 8.1 A number of specialized “toolboxes”

2 What Is MATLAB? MATLAB has two different methods for executing commands: interactive mode and batch mode. In interactive mode, commands are typed (or cut and pasted) into the command window. In batch mode, a series of commands is saved in a text file with a .m extension. The batch commands in a file are then executed by typing the name of the file at the MATLAB command prompt.

3 The MATLAB Language MATLAB is an interpreted language. Commands are executed line by line. It supports two basic types: characters like 'a' (16 bits) and doubles like 8.25 (64 bits). Most of the time MATLAB works with arrays or matrices of real numbers or characters. Other types are also supported: complex, symbolic (if installed), 16-bit and 8-bit integers, etc...

4 Problem Solving A standardized approach to problem solving commonly found in all science disciplines. 1.first you state the problem, 2.then describe the input and output. 3. Develop a plan for solving the problem, called an algorithm. 4.Then you actually solve the problem, in our case using MATLAB, and 5. finally you test your solution for reasonableness. If you use a consistent problem solving strategy you increase the chance that your result is correct

5 MATLAB

6 MATLAB uses a standard windows menu bar
To exit MATLAB use the close icon

7 MATLAB Windows Workspace Window Current Folder Window Command Window
Lists files stored in the current directory Command Window Enter commands at the prompt MATLAB Windows Command History Window Records all commands issued in the command window – including mistakes

8 The MATLAB Desktop Workspace Window Current Folder Window
Command Window Workspace Window Command History Window

9 Let’s look at the windows one at a time

10 The Command Window At the prompt (>>), type in a MATLAB command. Press the ENTER key. MATLAB displays the result in the command window, followed by a prompt. Repeat the process.

11 Notes on the Command Window
To start a command, make sure cursor is next to the prompt. MATLAB won’t respond until you press ENTER. It then executes only the last command. Commands before the last one may still be visible, but MATLAB doesn’t execute them.

12 Notes on the Command Window
You can type several commands in the same line by putting a comma between commands. (makes the program harder to read though, so it is not recommended). If a command is too long to fit on one line, you can continue to the next line by typing ellipsis (3 periods, i.e., … ) and then pressing ENTER.

13 Navigating the Command Window
When cursor is in the bottom (current) command line:  key moves the cursor one character to the left.  key moves the cursor one character to the right.  key recalls the preceding command  key recalls a previous command if it follows.

14 Command Window Similar to a scratch pad
Once you hit enter, you can’t edit any commands You can retype them or use the arrow keys to retrieve commands and edit them before hitting enter again Command Window

15 Navigating the Command Window
The PAGE-UP key moves up to previous commands in a window-size at a time. The PAGE-DOWN key moves down to previous commands in a window-size at a time. The BACKSPACE (Delete on Mac) key deletes one character to the left of the cursor. The DELETE (fn-Delete on Mac) key deletes one character to the right of the cursor.

16 To quickly execute a previous command but with small changes:
Recall the command with the up and down arrow keys. Use the left and right arrow keys to move to characters to be altered. Use BACKSPACE (Mac: Delete) or DELETE (Mac: fn-Delete) to remove old characters, then type new characters. Press ENTER to execute the modified command. T I P

17 Command Syntax Semicolon (;)
When typed at end of a command, it suppresses the output. (only the prompt is displayed at the next line) Useful for preventing display of large outputs Used much more in scripts (see Section 1.8 of text book) Percent sign (%) When typed at beginning of a line, MATLAB treats the line as a comment and doesn’t execute the line. Also used much more in scripts.

18 The clc Command Clears the command window display.
The up and down arrows still bring back the previous commands.

19 The Command History Window
Shows the previous commands, including the ones from previous MATLAB sessions. Double-clicking on a command puts it in the command window and executes it. You can drag a command to the command window, make changes in it, then execute it.

20 Command History Records the commands you issue in the command window
When you exit the command window, or when you issue the clc command, the command window is cleared But the command history remains

21 Command History You can transfer commands from the command history to the command window Double click on a command It executes immediately Click and drag into the command window You can edit the command before executing

22 Workspace Window Workspace Window

23 NOTE! When you define variables in the command window, they are listed in the workspace window Document Window: If you double click on any variable in the workspace window MATLAB launches a document window containing the array editor You can edit variables in the array editor Figure Window: When Figures are created a new window opens It’s extremely easy to create graphs in MATLAB

24 The Figure Window Figure Window The Figure Window opens automatically after any command that draws a graph.

25 Scalar Vector 2-D Matrix

26 Current Directory/Folder
The current folder window is a list of files When you try to load information from a file or try to save information – MATLAB uses the current folder

27 The Document Window displays the variable editor
New Variable Icon The Document Window displays the variable editor

28 First create a vector of x values – then a corresponding vector of y values
Note: The semicolon suppresses the output from each command

29 Matlab makes it easy to modify graphs by adding
Titles Axis labels Legends Other types of annotations

30

31 MATLAB

32 Command Syntax Semicolon (;)
When typed at end of a command, it suppresses the output. (only the prompt is displayed at the next line) Useful for preventing display of large outputs Used much more in scripts (see Section 1.8 of text book) Percent sign (%) When typed at beginning of a line, MATLAB treats the line as a comment and doesn’t execute the line. Also used much more in scripts.

33 The clc Command Clears the command window display.
The up and down arrows still bring back the previous commands.

34 First create a vector of x values – then a corresponding vector of y values
Note: The semicolon suppresses the output from each command

35 Matlab makes it easy to modify graphs by adding
Titles Axis labels Legends Other types of annotations

36 Editing Window This window allows you to type and save a series of commands without executing them There are several ways to open an editing window From the file menu With the new file icon

37 Open an editing window from the file menu or with the new file icon

38 New file icon

39 The Editor Window Editor/Debugger Window Use the editor/debugger window to write and debug MATLAB scripts. Open with the Edit command.

40 The Help Window Get the help window from the Help menu in any MATLAB window. (may vary according to version)


Download ppt "Release Numbers MATLAB is updated regularly"

Similar presentations


Ads by Google