EE100_Intro_Matlab - Milwaukee School of Engineering(c MSOE...

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

View Full Document Right Arrow Icon
Milwaukee School of Engineering (c) MSOE 2007 Dr.-Ing. Joerg Mossbrucker EE100 Introduction to Matlab 1 Starting Matlab You can start MATLAB by invoking the application from the Start menu of Windows. The main MATLAB window, called the MATLAB Desktop, will then pop-up and it will look like this: The ">>" is called the command prompt, and there will be a blinking cursor right after it waiting for you to type something. The idea is that you type commands at the command prompt for MATLAB to execute; after you type a command at a command prompt, MATLAB executes the command you typed in, then prints out the result. It then prints out another command prompt and waits for you to enter another command. In this way, you can interactively enter as many commands to MATLAB as you want. >> date ans = 10-Sep-2007 where the current date should be returned. There are three main functions that you can use to obtain help, “help”, “helpwin” and “doc”.
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 >> help date DATE Current date as date string. S = DATE returns a string containing the date in dd-mmm-yyyy format. See also now, clock, datenum. Reference page in Help browser doc date The function “help” and “helpwin” give you the same information but in different format. It is important to know how to abort a command in Matlab, since the output of some functions cause the computer to print seemingly endless lists of numbers or the computer seems to go into an endless loop. In these cases hold down the control key and press c to generate a local abort within Matlab. 2 Variables and Calculations Matlab allows you to do simple calculations just like on any handheld calculator. Results can be stored in variables as follows: >> a=5 a = 5 Note that variables need not be declared and that the type of a variable (i.e. if it holds a scalar value or a matrix for example) can change dynamically. Very often intermediate results do not need to be printed on-screen. A semi-colon at the end of any command will suppress print-out: >> a=5; >> To keep track of all used variables the “whos” function can be used which prints out the contents of all current variables:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

EE100_Intro_Matlab - Milwaukee School of Engineering(c MSOE...

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

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