This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Edward Neuman Department of Mathematics Southern Illinois University at Carbondale [email protected] The purpose of this tutorial is to present basics of MATLAB. We do not assume any prior knowledge of this package. This tutorial is intended for users running a professional version of MATLAB 5.3, Release 11 under Windows 95. Topics discussed in this tutorial include the Command Window , numbers and arithmetic operations, saving and reloading a work, using help, MATLAB demos, interrupting a running program, long command lines, and MATLAB resources on the Internet. You can start MATLAB by double clicking on the MATLAB icon that should be on the desktop of your computer. This brings up the window called the Command Window . This window allows a user to enter simple commands. To clear the Command Window type clc and next press the Enter or Return key. To perform a simple computations type a command and next press the Enter or Return key. For instance, s = 1 + 2 s = 3 fun = sin(pi/4) fun = 0.7071 In the second example the trigonometric function sine and the constant are used. In MATLAB they are named sin and pi , respectively. Note that the results of these computations are saved in variables whose names are chosen by the user. If they will be needed during your current MATLAB session, then you can obtain their values typing their names and pressing the Enter or Return key. For instance, 2 s s = 3 Variable name begins with a letter, followed by letters, numbers or underscores. MATLAB recognizes only the first 31 characters of a variable name. To change a format of numbers displayed in the Command Window you can use one of the several formats that are available in MATLAB. The default format is called short (four digits after the decimal point.) In order to display more digits click on File , select Preferences… , and next select a format you wish to use. They are listed below the Numeric Format . Next click on Apply and OK and close the current window. You can also select a new format from within the Command Window . For instance, the following command format long changes a current format to the format long. To display more digits of the variable fun type fun fun = 0.70710678118655 To change a current format to the default one type format short fun fun = 0.7071 To close MATLAB type exit in the Command Window and next press Enter or Return key. A second way to close your current MATLAB session is to select File in the MATLAB's toolbar and next click on Exit MATLAB option. All unsaved information residing in the MATLAB Workspace will be lost. There are three kinds of numbers used in MATLAB: • integers • real numbers • complex numbers Integers are enterd without the decimal point 3 xi = 10 xi = 10 However, the following number xr = 10.01 xr = 10.0100 is saved as the real number. It is not our intention to discuss here machine representation of numbers. This topic is usually included in the numerical analysis courses.numbers....
View
Full
Document
This note was uploaded on 03/19/2008 for the course BME 311 taught by Professor Zhang during the Spring '08 term at University of Texas at Austin.
 Spring '08
 Zhang

Click to edit the document details