MATLAB_tutorial - MATLAB Basics I OPENING MATLAB M-FILES...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
MATLAB: Basics I. OPENING MATLAB, M-FILES, ENTERING COMMANDS, SAVING AND RUNNING, ERROR MESSAGE DISPLAYS, NUMERICAL OUTPUT 1. MATLAB environment: When Matlab is first opened, the following screen is displayed: The three windows include: The command window is on the right. Matlab commands are entered in this window, numerical output is displayed and error messages appear in this window. The workspace contains a list of variables, vectors and matrices that have been declared. The command history keeps a running record of the commands that have been used. 2. M-file editor In order to store, edit and repeat sequence of commands, an M-file is created by selecting File>New>M-file. A new window opens:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Type commands (Script file) in here such as: To run this program, select Debug>Save and Run. A popup menu asks for a file name the first time you save your program. Once the directory and file name are specified, click on save. This will save the M-file and execute the commands.
Background image of page 2
A syntax error was found, displayed in the command window and execution was aborted. With both parentheses the program executes and the results are displayed in the command window: Here are some useful commands:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
clear all - erases all variable assignments clc – clears the command window screen help function name – displays documentation for the specified function In addition, clicking on Help>Matlab Help on the menu bar opens a help window. One option within this window is to display a list of functions in alphabetical order.
Background image of page 4
II. ENTERING VECTORS AND MATRICES IN MATLAB, MATRIX OPERATIONS
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

MATLAB_tutorial - MATLAB Basics I OPENING MATLAB M-FILES...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online