Starting a New Matlab m.file. Matlab m.files. Matlab m.file Editor/Debugger. The clear all Command. Our Program So Far
|
|
- Homer Fletcher
- 6 years ago
- Views:
Transcription
1 Matlab m.files It is not very convenient to do work directly in the Matlab Command Line Window since: It is hard to remember what we typed. It is hard to edit. It all disappears when we close Matlab. Solution: Use Matlab m.files. Also called or script or program files. We will first re-do the example from lesson 4.2 as a Matlab m.file. We will then add some new features / commands. Starting a New Matlab m.file Go to File = > New => M-file OR Click the New M-file button Matlab m.file Editor/Debugger The Matlab Editor/Debugger will open in a New Window. We will type all our Program Commands in this Window. Any text editor can also be used (but NOT recommended). The Command Window will only be used to Run Programs, Get Answers, Get Help, and Help Debug Programs. The clear all Command As we saw before, to wipe out ALL the memory we use the clear all command. We need clear all the memory each and every time we run a program. We could type the clear all command in the command window every time but that is inefficient. The solution is to put the clear all command as the first executable command in our m.file. Type the following in the Editor Window: clear all We will get to non-executable commands in a few minutes. Enter The Time - Temperature Data As before, we want to create two vectors to store the time and temperature data. As before let s call them time and temp respectively. Type: time = [ ] temp = [ ] in the Editor Window AFTER the clear all command. DO NOT put a semicolon ( ; ) at the end of the time and temp data statements for the time being. Our Program So Far You editor window should like the figure above. Note, the file name appears in the top of the window. Since we have not named the file, the name is Untitled. The asterisk ( * ) after the file name indicates that we have NOT saved the file since our last additions or changes. We will go to File = > Save or Save As to save the file. You can also click the floppy disk icon (button).
2 m.file Naming Rules Syntax: FileName.m The file name can be any combination of letters, numbers, and the underscore ( _ ) character. The FIRST character MUST be a letter. No blank spaces, dashes ( - ) or other non-alphanumeric characters (other than the underscore) are allowed. It is case sensitive (MyFile.m is different than myfile.m). You CANNOT use a Matlab reserved name (e.g., pi, ans, etc.) or Matlab commands (e.g., plot, title, atan, etc.) for the file name. The file extension.m must be part of the name. The Matlab Editor does this automatically. Save and Run Our m.file Save the file to the H:\ drive (your space on the server). Name the file: as4_3.m The editor will automatically add the.m extension. In the Matlab Command Window type:» as4_3 and hit return (DO NOT type the.m extension). Changing the Path Did you get the statement?» as4_3??? Undefined function or variable 'as4_3'. This is because Matlab DID NOT know where to find our file. We need to tell Matlab to look on the H:\ drive. In the Command Window type:» CD H:\ and hit return. Matlab will now look on the H:\ drive first for our file. You must do this EVERY TIME you start Matlab (if your files are stored on the the H:\ drive). Run Our m.file Again Are all your values correct? Did you get the above in the Command Window? All three (3) lines of our program were executed. The time and temp vector definitions were echoed since we did NOT put a semicolons ( ; ) at the end of the lines. Add the Plot to Our Program Edit our file in the Matlab Editor: temp = [ ]; plot(time,temp,'r^'); Click the Floppy Disk Icon in the Editor Window. Run the program again in the Command Window. A Figure Window should open up with the following plot: Add the plot and axis commands. Note the maroon color when both single quotes are used. Now, put a semicolon ( ; ) at the end of all lines. Suppresses echoing of the time and temp data. Not necessary for the other commands but is good practice.
3 Add the Plot Annotation to the Program Edit our file in the Matlab Editor: This is one line. temp = [ ]; plot(time,temp,'r^'); title('coffee Temperature vs Time - Add the title, xlabel, and ylabel commands. Note the maroon color when both single quotes are used. Click the Floppy Disk Icon in the Editor Window. Run the program again in the Command Window. The Figure Window should have the following plot: Modified Example The first cup I used was plastic. I did the experiment again with a ceramic cup. I measured the temperature at the same time intervals I used for the plastic cup (I didn t have to but I did). All the data is on the next slide. I want to keep my first plot as it now appears. I want to add a second plot that includes both sets of data on the same graph. This will require a legend since there will be more than one data set on the same plot. Note, the ceramic cup appears to be a better cup. Temperature of the Coffee in Two Cups as a Function of Time Cup 1 - Plastic Cup 2 - Ceramic Time Temperature Temperature ( minutes ) ( degrees F ) ( degrees F ) We Need To Tell Matlab To: Add the temperature data for the ceramic cup. Keep our current plot for the plastic cup as is. Create a New Plot that contains both sets of data. Set the type and color data marks for the new plot. Set the axes limits & gradations for the new plot. Define the title and axes labels for the new plot. Add a legend to the new plot. Again, developing this short plan is the MOST IMPORTANT step in the entire solution process!!! Editing Matlab m.files Close Matlab! Yes, close Matlab. Closing the Matlab Command Window will close ALL windows. Open Matlab again! Yes, open Matlab again. Open our existing Matlab m.file. Go to File = > Open OR Click the Open File button Go to the the H:\ drive and open the file: as4_3.m
4 Enter The Time - Temperature Data Now we need three (3) vectors to store the time and temperature data for the two cups. We also need to differentiate between the temperature in the plastic cup (cup 1) and the ceramic cup (cup 2). Let s call them time, cup1_temp and cup2_temp. Change the name of temp to cup1_temp. Add the cup2_temp vector. The three data vectors should be as follows: Our Edited Program Since we changed the name of temp to cup1_temp, we need to change the plot command also. Our file in the Matlab Editor should look like: title( Coffee Temperature vs Time - This is one line. Save and Run the Program Click the Floppy Disk Icon in the Editor Window. Notice that the asterisk ( * ) disappears. Run the program again in the Command Window. Type as4_3 and hit return. Did you get the statement?» as4_3??? Undefined function or variable 'as4_3'. Did you add the H:\ drive to your Path? Type CD H:\ in the command window and hit return. Run the program again. Type as4_3 and hit return. Did you get back the original plot? You should have! So Where Are We On Our Plan? Add the temperature data for the ceramic cup. Keep our current plot for the plastic cup as is. Create a New Plot that contains both sets of data. Set the type and color data marks for the new plot. Set the axes limits & gradations for the new plot. Define the title and axes labels for the new plot. Add a legend to the new plot. Maybe the Help File on plot will be helpful!! Maybe the Help File on 2-D graphs will be helpful!! Looks like we need the axis, title, xlabel, and ylabel commands again. Go to the Help File on plot The syntax to get two or more data sets is: vector of independent variable values for data set 1 vector of dependent variable values for data set 1 format code for data set 1 vector of independent variable values for data set 2 vector of dependent variable values for data set 2 format code for data set 2 etc. Add the Second plot Command to Our Program In our case both data sets use the same vector of independent variable values (i.e., the vector time). This is NOT necessary in general. We could have made our temperature measurements at different times for the two cups if we wanted. Plot the cup 1 data using blue triangles. Plot the cup 2 data using red circles. Therefore, we need to add the following command at the end of our program:
5 Our Edited Program Our file in the Matlab Editor should look like: title( Coffee Temperature vs Time - The Figure Window should now look like the following: Any Problems? Obviously: We need to adjust the axes scales. We need to add the title and axes labels. We need to add a legend. What happened to our first plot? The second plot command overwrote the first plot command. (and we then also lost all the axis, title, xlabel, and ylabel information). We need to tell Matlab to plot the two plots in separate windows! How do we do this? It is not real obvious and a little difficult to find in the Help File. Handle Graphics Matlab refers to all general graphics items as Handle Graphics. Open the Help Window: Double Click Here More on Handle Graphics The figure Command We want to look at these two commands. We will look at some of these commands in the near future. In English, the figure(h) command: Opens a new figure window numbered H if that figure window is NOT already opened. Activates the figure window numbered H if that figure window IS already opened. Either way, ALL plotting commands will appear in the figure window numbered H until the next figure command is given.
6 The clf reset Command In English, the clf reset command: Clears and resets all parameters (title, plot, etc.) of the active figure window. Should appear after every figure(h) command. Let s edit our program file. Our file in the Matlab Editor should look like: figure(1); clf reset Add these lines. title( Coffee Temperature vs Time - figure(2); clf reset; Two Figure Windows should now look like the following: You have to move figure 2 to see figure 1 Clean up the Second Plot Edit our file in the Matlab Editor: figure(2); clf reset; title('coffee Temperatures vs Time - The rest of the code is NOT shown. This is one line. Add the axis, title, xlabel, and ylabel commands. We can use the same axes limits Note the slight change in the title. Figure Window 2 should now look like the following: We need a legend! Go to the help file. Key Statements
7 The legend Command The legend command syntax: This is one line. legend('text for 1st data','text for 2nd data',,position on plot); The text can be anything we want but should be short. The order of text descriptions MUST be the same as the order of the data sets we plotted. For position it is best to use 0 (zero) so we can move the legend where we want it. Add the following line after the ylabel command for the second plot: legend('cup1 - Plastic','Cup 2 - Ceramic',0); Figure Window 2 should now look like the following: Try moving the legend around with the mouse. % - The Comment Operator If Matlab sees a % (percent sign) it ignores the rest of the line. The exception is if the % is inside a command. Therefore, we can use this % to add "comments" to our programs. Comments are used to tell the reader what is going on in the program at various points. The Comment Operator is a non-executable command and can appear BEFORE the clear all command. Undocumented or Poorly Documented program are Unacceptable!!! Examples of the comment operator: % Clear all memory % Enter time and temperature data. % Activate figure 1 and clear all parameters. figure(1); clf reset; % Create plot 1 and set axes limits. The blank lines make it more readable. Notice, the comments are always green. Our Standard header We will use a standard header the contains: A place for your section name, date, and name. A brief program description. A listing and brief description of all variables The standard header is available on the web site. Download the header to your file area on the H:\ drive. Open the header using the Matlab Editor. Use Cut and Paste to insert the header into your program. Edit as needed. See examples on the web site. Matlab Homework Format All homework will follow the required format: Cover page - handwritten. DOCUMENTED m.file. PROPER plots and other formatted output as required. Assumptions, discussions, further calculations, etc. as required. All m.files will include: Standard header. Appropriate number of in-line comments. End of program statement. See web site for examples.
MATLAB - Lecture # 4
MATLAB - Lecture # 4 Script Files / Chapter 4 Topics Covered: 1. Script files. SCRIPT FILE 77-78! A script file is a sequence of MATLAB commands, called a program.! When a file runs, MATLAB executes the
More informationMATLAB Introduction To Engineering for ECE Topics Covered: 1. Creating Script Files (.m files) 2. Using the Real Time Debugger
25.108 Introduction To Engineering for ECE Topics Covered: 1. Creating Script Files (.m files) 2. Using the Real Time Debugger SCRIPT FILE 77-78 A script file is a sequence of MATLAB commands, called a
More informationAMS 27L LAB #2 Winter 2009
AMS 27L LAB #2 Winter 2009 Plots and Matrix Algebra in MATLAB Objectives: 1. To practice basic display methods 2. To learn how to program loops 3. To learn how to write m-files 1 Vectors Matlab handles
More informationCreates a 1 X 1 matrix (scalar) with a value of 1 in the column 1, row 1 position and prints the matrix aaa in the command window.
EE 350L: Signals and Transforms Lab Spring 2007 Lab #1 - Introduction to MATLAB Lab Handout Matlab Software: Matlab will be the analytical tool used in the signals lab. The laboratory has network licenses
More informationMATLAB Introduction to MATLAB Programming
MATLAB Introduction to MATLAB Programming MATLAB Scripts So far we have typed all the commands in the Command Window which were executed when we hit Enter. Although every MATLAB command can be executed
More information2D LINE PLOTS... 1 The plot() Command... 1 Labeling and Annotating Figures... 5 The subplot() Command... 7 The polarplot() Command...
Contents 2D LINE PLOTS... 1 The plot() Command... 1 Labeling and Annotating Figures... 5 The subplot() Command... 7 The polarplot() Command... 9 2D LINE PLOTS One of the benefits of programming in MATLAB
More informationMATLAB Fundamentals. Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University
MATLAB Fundamentals Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University Reference: 1. Applied Numerical Methods with MATLAB for Engineers, Chapter 2 &
More informationVariable Definition and Statement Suppression You can create your own variables, and assign them values using = >> a = a = 3.
MATLAB Introduction Accessing Matlab... Matlab Interface... The Basics... 2 Variable Definition and Statement Suppression... 2 Keyboard Shortcuts... More Common Functions... 4 Vectors and Matrices... 4
More informationThis module aims to introduce Precalculus high school students to the basic capabilities of Matlab by using functions. Matlab will be used in
This module aims to introduce Precalculus high school students to the basic capabilities of Matlab by using functions. Matlab will be used in subsequent modules to help to teach research related concepts
More informationMAT 275 Laboratory 1 Introduction to MATLAB
MATLAB sessions: Laboratory 1 1 MAT 275 Laboratory 1 Introduction to MATLAB MATLAB is a computer software commonly used in both education and industry to solve a wide range of problems. This Laboratory
More information1 Introduction to Matlab
1 Introduction to Matlab 1. What is Matlab? Matlab is a computer program designed to do mathematics. You might think of it as a super-calculator. That is, once Matlab has been started, you can enter computations,
More informationProf. Manoochehr Shirzaei. RaTlab.asu.edu
RaTlab.asu.edu Introduction To MATLAB Introduction To MATLAB This lecture is an introduction of the basic MATLAB commands. We learn; Functions Procedures for naming and saving the user generated files
More informationDepartment of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial Vb
Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial Vb Making Plots with Matlab (last updated 5/29/05 by GGB) Objectives: These tutorials are
More informationPART 1 PROGRAMMING WITH MATHLAB
PART 1 PROGRAMMING WITH MATHLAB Presenter: Dr. Zalilah Sharer 2018 School of Chemical and Energy Engineering Universiti Teknologi Malaysia 23 September 2018 Programming with MATHLAB MATLAB Environment
More informationLab 1 Intro to MATLAB and FreeMat
Lab 1 Intro to MATLAB and FreeMat Objectives concepts 1. Variables, vectors, and arrays 2. Plotting data 3. Script files skills 1. Use MATLAB to solve homework problems 2. Plot lab data and mathematical
More informationIntroduction to MATLAB Programming. Chapter 3. Linguaggio Programmazione Matlab-Simulink (2017/2018)
Introduction to MATLAB Programming Chapter 3 Linguaggio Programmazione Matlab-Simulink (2017/2018) Algorithms An algorithm is the sequence of steps needed to solve a problem Top-down design approach to
More informationPowerPoints organized by Dr. Michael R. Gustafson II, Duke University
Part 1 Chapter 2 MATLAB Fundamentals PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
More informationA Brief Introduction to MATLAB
A Brief Introduction to MATLAB MATLAB (Matrix Laboratory) is an interactive software system for numerical computations and graphics. As the name suggests, MATLAB was first designed for matrix computations:
More informationMatlab Tutorial 1: Working with variables, arrays, and plotting
Matlab Tutorial 1: Working with variables, arrays, and plotting Setting up Matlab First of all, let's make sure we all have the same layout of the different windows in Matlab. Go to Home Layout Default.
More informationChapter 1: An Overview of MATLAB
Chapter 1: An Overview of MATLAB MATLAB is: A high-level language and interactive environment for numerical computation, visualization, and programming MATLAB can: Be used as a calculator, easily create
More informationMathworks (company that releases Matlab ) documentation website is:
1 Getting Started The Mathematics Behind Biological Invasions Introduction to Matlab in UNIX Christina Cobbold and Tomas de Camino Beck as modified for UNIX by Fred Adler Logging in: This is what you do
More informationELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)
Introduction ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) MATLAB is a powerful mathematical language that is used in most engineering companies today. Its strength lies
More informationWhat is MATLAB? It is a high-level programming language. for numerical computations for symbolic computations for scientific visualizations
What is MATLAB? It stands for MATrix LABoratory It is developed by The Mathworks, Inc (http://www.mathworks.com) It is an interactive, integrated, environment for numerical computations for symbolic computations
More informationAPPM 2460 PLOTTING IN MATLAB
APPM 2460 PLOTTING IN MATLAB. Introduction Matlab is great at crunching numbers, and one of the fundamental ways that we understand the output of this number-crunching is through visualization, or plots.
More informationChapter 2. MATLAB Fundamentals
Chapter 2. MATLAB Fundamentals Choi Hae Jin Chapter Objectives q Learning how real and complex numbers are assigned to variables. q Learning how vectors and matrices are assigned values using simple assignment,
More informationMATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks
MATLAB Basics Stanley Liang, PhD York University Configure a MATLAB Package Get a MATLAB Student License on Matworks Visit MathWorks at https://www.mathworks.com/ It is recommended signing up with a student
More information12 whereas if I terminate the expression with a semicolon, the printed output is suppressed.
Example 4 Printing and Plotting Matlab provides numerous print and plot options. This example illustrates the basics and provides enough detail that you can use it for typical classroom work and assignments.
More informationVARIABLES Storing numbers:
VARIABLES Storing numbers: You may create and use variables in Matlab to store data. There are a few rules on naming variables though: (1) Variables must begin with a letter and can be followed with any
More informationGetting Started. Chapter 1. How to Get Matlab. 1.1 Before We Begin Matlab to Accompany Lay s Linear Algebra Text
Chapter 1 Getting Started How to Get Matlab Matlab physically resides on each of the computers in the Olin Hall labs. See your instructor if you need an account on these machines. If you are going to go
More informationMATLAB Tutorial. Primary Author: Shoumik Chatterjee Secondary Author: Dr. Chuan Li
MATLAB Tutorial Primary Author: Shoumik Chatterjee Secondary Author: Dr. Chuan Li 1 Table of Contents Section 1: Accessing MATLAB using RamCloud server...3 Section 2: MATLAB GUI Basics. 6 Section 3: MATLAB
More informationVariables are used to store data (numbers, letters, etc) in MATLAB. There are a few rules that must be followed when creating variables in MATLAB:
Contents VARIABLES... 1 Storing Numerical Data... 2 Limits on Numerical Data... 6 Storing Character Strings... 8 Logical Variables... 9 MATLAB S BUILT-IN VARIABLES AND FUNCTIONS... 9 GETTING HELP IN MATLAB...
More informationStarting with a great calculator... Variables. Comments. Topic 5: Introduction to Programming in Matlab CSSE, UWA
Starting with a great calculator... Topic 5: Introduction to Programming in Matlab CSSE, UWA! MATLAB is a high level language that allows you to perform calculations on numbers, or arrays of numbers, in
More informationData needs to be prepped for loading into matlab.
Outline Preparing data sets CTD Data from Tomales Bay Clean up Binning Combined Temperature Depth plots T S scatter plots Multiple plots on a single figure What haven't you learned in this class? Preparing
More informationEGR 111 Plotting Data
EGR 111 Plotting Data This lab shows how to import data, plot data, and write script files. This lab also describes the Current Folder, the comment symbol ( % ), and MATLAB file names. New MATLAB Commands:
More informationMatlab Introduction. Scalar Variables and Arithmetic Operators
Matlab Introduction Matlab is both a powerful computational environment and a programming language that easily handles matrix and complex arithmetic. It is a large software package that has many advanced
More informationIntroduction to Matlab
What is Matlab? Introduction to Matlab Matlab is software written by a company called The Mathworks (mathworks.com), and was first created in 1984 to be a nice front end to the numerical routines created
More informationLaboratory 1 Octave Tutorial
Signals, Spectra and Signal Processing Laboratory 1 Octave Tutorial 1.1 Introduction The purpose of this lab 1 is to become familiar with the GNU Octave 2 software environment. 1.2 Octave Review All laboratory
More informationINTRODUCTION TO MATLAB PLOTTING WITH MATLAB
1 INTRODUCTION TO MATLAB PLOTTING WITH MATLAB Plotting with MATLAB x-y plot Plotting with MATLAB MATLAB contains many powerful functions for easily creating plots of several different types. Command plot(x,y)
More informationLecture 1 Getting Started with SAS
SAS for Data Management, Analysis, and Reporting Lecture 1 Getting Started with SAS Portions reproduced with permission of SAS Institute Inc., Cary, NC, USA Goals of the course To provide skills required
More informationEE 350. Continuous-Time Linear Systems. Recitation 1. 1
EE 350 Continuous-Time Linear Systems Recitation 1 Recitation 1. 1 Recitation 1 Topics MATLAB Programming Basic Operations, Built-In Functions, and Variables m-files Graphics: 2D plots EE 210 Review Branch
More informationDesktop Command window
Chapter 1 Matlab Overview EGR1302 Desktop Command window Current Directory window Tb Tabs to toggle between Current Directory & Workspace Windows Command History window 1 Desktop Default appearance Command
More informationMATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY
MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY What is MATLAB? MATLAB (MATrix LABoratory) developed by The Mathworks, Inc. (http://www.mathworks.com) Key Features: High-level language for numerical
More informationMATLAB Project: Getting Started with MATLAB
Name Purpose: To learn to create matrices and use various MATLAB commands for reference later MATLAB built-in functions used: [ ] : ; + - * ^, size, help, format, eye, zeros, ones, diag, rand, round, cos,
More informationA Guide to Using Some Basic MATLAB Functions
A Guide to Using Some Basic MATLAB Functions UNC Charlotte Robert W. Cox This document provides a brief overview of some of the essential MATLAB functionality. More thorough descriptions are available
More informationIntroduction to Matlab to Accompany Linear Algebra. Douglas Hundley Department of Mathematics and Statistics Whitman College
Introduction to Matlab to Accompany Linear Algebra Douglas Hundley Department of Mathematics and Statistics Whitman College August 27, 2018 2 Contents 1 Getting Started 5 1.1 Before We Begin........................................
More informationDr Richard Greenaway
SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 2 Basic MATLAB Operation Dr Richard Greenaway 2 Basic MATLAB Operation 2.1 Overview 2.1.1 The Command Line In this Workshop you will learn how
More informationIntroduction to MATLAB
Chapter 1 Introduction to MATLAB 1.1 Software Philosophy Matrix-based numeric computation MATrix LABoratory built-in support for standard matrix and vector operations High-level programming language Programming
More informationMATLAB Introductory Course Computer Exercise Session
MATLAB Introductory Course Computer Exercise Session This course is a basic introduction for students that did not use MATLAB before. The solutions will not be collected. Work through the course within
More informationIntroduction to the MATLAB SIMULINK Program
Introduction to the MATLAB SIMULINK Program Adapted from similar document by Dept. of Chemical Engineering, UC - Santa Barbara MATLAB, which stands for MATrix LABoratory, is a technical computing environment
More informationIntroduction to MATLAB
Introduction to MATLAB The Desktop When you start MATLAB, the desktop appears, containing tools (graphical user interfaces) for managing files, variables, and applications associated with MATLAB. The following
More informationMath 1322, Fall 2002 Introduction to Matlab: Basic Commands
Math 1322, Fall 2002 Introduction to Matlab: Basic Commands You should look at Sections 1.1-1.3 of the Matlab reference book ( Using Matlab in Calculus by Gary Jensen), preferably with Matlab running in
More informationCSE/NEUBEH 528 Homework 0: Introduction to Matlab
CSE/NEUBEH 528 Homework 0: Introduction to Matlab (Practice only: Do not turn in) Okay, let s begin! Open Matlab by double-clicking the Matlab icon (on MS Windows systems) or typing matlab at the prompt
More informationIntroduction to MATLAB
58:110 Computer-Aided Engineering Spring 2005 Introduction to MATLAB Department of Mechanical and industrial engineering January 2005 Topics Introduction Running MATLAB and MATLAB Environment Getting help
More informationMATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c.
MATLAB BASICS Starting Matlab < PC: Desktop icon or Start menu item < UNIX: Enter matlab at operating system prompt < Others: Might need to execute from a menu somewhere Entering Matlab commands < Matlab
More informationECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu
ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu 0. What is MATLAB? 1 MATLAB stands for matrix laboratory and is one of the most popular software for numerical computation. MATLAB s basic
More informationMATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras
MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras Module No. #01 Lecture No. #1.1 Introduction to MATLAB programming
More informationMATLAB SUMMARY FOR MATH2070/2970
MATLAB SUMMARY FOR MATH2070/2970 DUNCAN SUTHERLAND 1. Introduction The following is inted as a guide containing all relevant Matlab commands and concepts for MATH2070 and 2970. All code fragments should
More informationIntroduction to MATLAB
CHEE MATLAB Tutorial Introduction to MATLAB Introduction In this tutorial, you will learn how to enter matrices and perform some matrix operations using MATLAB. MATLAB is an interactive program for numerical
More informationLab # 2. For today s lab:
1 ITI 1120 Lab # 2 Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot 1 For today s lab: Go the course webpage Follow the links to the lab notes for Lab 2. Save all the java programs you
More informationAMATH 352: MATLAB Tutorial written by Peter Blossey Department of Applied Mathematics University of Washington Seattle, WA
AMATH 352: MATLAB Tutorial written by Peter Blossey Department of Applied Mathematics University of Washington Seattle, WA MATLAB (short for MATrix LABoratory) is a very useful piece of software for numerical
More informationAppendix A. Introduction to MATLAB. A.1 What Is MATLAB?
Appendix A Introduction to MATLAB A.1 What Is MATLAB? MATLAB is a technical computing environment developed by The Math- Works, Inc. for computation and data visualization. It is both an interactive system
More informationENGR 253 LAB #1 - MATLAB Introduction
ENGR 253 LAB #1 - MATLAB Introduction Objective Understanding and hands on experience with MATLAB with focus on Signal Processing. Resources Signals & Systems textbook by Oppenheim and Willsky Windows
More informationLecture 1: Hello, MATLAB!
Lecture 1: Hello, MATLAB! Math 98, Spring 2018 Math 98, Spring 2018 Lecture 1: Hello, MATLAB! 1 / 21 Syllabus Instructor: Eric Hallman Class Website: https://math.berkeley.edu/~ehallman/98-fa18/ Login:!cmfmath98
More informationSTAT 391 Handout 1 Making Plots with Matlab Mar 26, 2006
STAT 39 Handout Making Plots with Matlab Mar 26, 26 c Marina Meilă & Lei Xu mmp@cs.washington.edu This is intended to help you mainly with the graphics in the homework. Matlab is a matrix oriented mathematics
More informationMATLAB Project: Getting Started with MATLAB
Name Purpose: To learn to create matrices and use various MATLAB commands for reference later MATLAB functions used: [ ] : ; + - * ^, size, help, format, eye, zeros, ones, diag, rand, round, cos, sin,
More informationDAQFactory U3 Tutorial Getting Started with DAQFactory-Express and your LabJack U3 11/3/06
DAQFactory U3 Tutorial Getting Started with DAQFactory-Express and your LabJack U3 11/3/06 Congratulations on the purchase of your new LabJack U3. Included on your installation CD is a fully licensed copy
More informationECE 3793 Matlab Project 1
ECE 3793 Matlab Project 1 Spring 2017 Dr. Havlicek DUE: 02/04/2017, 11:59 PM Introduction: You will need to use Matlab to complete this assignment. So the first thing you need to do is figure out how you
More informationInteractive MATLAB use. Often, many steps are needed. Automated data processing is common in Earth science! only good if problem is simple
Chapter 2 Interactive MATLAB use only good if problem is simple Often, many steps are needed We also want to be able to automate repeated tasks Automated data processing is common in Earth science! Automated
More informationFitting data with Matlab
Fitting data with Matlab 1. Generate a delimited text file (from LabVIEW, a text editor, Excel, or another spreadsheet application) with the x values (time) in the first column and the y values (temperature)
More informationMATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline
MATLAB Tutorial EE351M DSP Created: Thursday Jan 25, 2007 Rayyan Jaber Modified by: Kitaek Bae Outline Part I: Introduction and Overview Part II: Matrix manipulations and common functions Part III: Plots
More informationIntroduction to Matlab
Introduction to Matlab November 22, 2013 Contents 1 Introduction to Matlab 1 1.1 What is Matlab.................................. 1 1.2 Matlab versus Maple............................... 2 1.3 Getting
More informationJava Programming Fundamentals - Day Instructor: Jason Yoon Website:
Java Programming Fundamentals - Day 1 07.09.2016 Instructor: Jason Yoon Website: http://mryoon.weebly.com Quick Advice Before We Get Started Java is not the same as javascript! Don t get them confused
More informationData and Function Plotting with MATLAB (Linux-10)
Data and Function Plotting with MATLAB (Linux-10) This tutorial describes the use of MATLAB for general plotting of experimental data and equations and for special plots like histograms. (Astronomers -
More informationShort Version of Matlab Manual
Short Version of Matlab Manual This is an extract from the manual which was used in MA10126 in first year. Its purpose is to refamiliarise you with the matlab programming concepts. 1 Starting MATLAB 1.1.1.
More informationObjectives. 1 Running, and Interface Layout. 2 Toolboxes, Documentation and Tutorials. 3 Basic Calculations. PS 12a Laboratory 1 Spring 2014
PS 12a Laboratory 1 Spring 2014 Objectives This session is a tutorial designed to a very quick overview of some of the numerical skills that you ll need to get started. Throughout the tutorial, the instructors
More informationPart #6. A0B17MTB Matlab. Miloslav Čapek Filip Kozák, Viktor Adler, Pavel Valtr
A0B17MTB Matlab Part #6 Miloslav Čapek miloslav.capek@fel.cvut.cz Filip Kozák, Viktor Adler, Pavel Valtr Department of Electromagnetic Field B2-626, Prague Learning how to Visualizing in Matlab #1 Debugging
More informationBasic Graphs. Dmitry Adamskiy 16 November 2011
Basic Graphs Dmitry Adamskiy adamskiy@cs.rhul.ac.uk 16 November 211 1 Plot Function plot(x,y): plots vector Y versus vector X X and Y must have the same size: X = [x1, x2 xn] and Y = [y1, y2,, yn] Broken
More informationA Very Brief Introduction to Matlab
A Very Brief Introduction to Matlab by John MacLaren Walsh, Ph.D. for ECES 63 Fall 26 October 3, 26 Introduction To MATLAB You can type normal mathematical operations into MATLAB as you would in an electronic
More informationIntroduction to MATLAB
Introduction to MATLAB 1 Introduction to MATLAB A Tutorial for the Course Computational Intelligence http://www.igi.tugraz.at/lehre/ci Stefan Häusler Institute for Theoretical Computer Science Inffeldgasse
More informationChapter 3: Introduction to MATLAB Programming (4 th ed.)
Chapter 3: Introduction to MATLAB Programming (4 th ed.) Algorithms MATLAB scripts Input / Output o disp versus fprintf Graphs Read and write variables (.mat files) User-defined Functions o Definition
More informationExamples, examples: Outline
Examples, examples: Outline Overview of todays exercises Basic scripting Importing data Working with temporal data Working with missing data Interpolation in 1D Some time series analysis Linear regression
More informationIntroduction to Matlab
Introduction to Matlab The purpose of this intro is to show some of Matlab s basic capabilities. Nir Gavish, 2.07 Contents Getting help Matlab development enviroment Variable definitions Mathematical operations
More informationComputational lab on complex numbers
Computational lab on complex numbers SAK, physics 1140 March 15, 2010 1 Objective To learn how to use MATLAB as an advanced calculator and gain familiarity with complex numbers using MATLAB. 2 Introduction
More informationIntroduction to Octave/Matlab. Deployment of Telecommunication Infrastructures
Introduction to Octave/Matlab Deployment of Telecommunication Infrastructures 1 What is Octave? Software for numerical computations and graphics Particularly designed for matrix computations Solving equations,
More informationGrace days can not be used for this assignment
CS513 Spring 19 Prof. Ron Matlab Assignment #0 Prepared by Narfi Stefansson Due January 30, 2019 Grace days can not be used for this assignment The Matlab assignments are not intended to be complete tutorials,
More informationCITS2401 Computer Analysis & Visualisation
FACULTY OF ENGINEERING, COMPUTING AND MATHEMATICS CITS2401 Computer Analysis & Visualisation SCHOOL OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING Topic 3 Introduction to Matlab Material from MATLAB for
More informationMatlab Programming MET 164 1/24
Matlab Programming 1/24 2/24 What does MATLAB mean? Contraction of Matrix Laboratory Matrices are rectangular arrays of numerical values 7 3 6 2 1 9 4 4 8 4 1 5 7 2 1 3 What are the fundamental components
More informationMechanical Engineering Department Second Year (2015)
Lecture 7: Graphs Basic Plotting MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. This section describes a few of the most
More informationINC151 Electrical Engineering Software Practice. MATLAB Graphics. Dr.Wanchak Lenwari :Control System and Instrumentation Engineering, KMUTT 1
INC151 Electrical Engineering Software Practice MATLAB Graphics Dr.Wanchak Lenwari :Control System and Instrumentation Engineering, KMUTT 1 Graphical display is one of MATLAB s greatest strengths and most
More informationMy First Cocoa Program
My First Cocoa Program 1. Tutorial Overview In this tutorial, you re going to create a very simple Cocoa application for the Mac. Unlike a line-command program, a Cocoa program uses a graphical window
More informationMatlab Tutorial and Exercises for COMP61021
Matlab Tutorial and Exercises for COMP61021 1 Introduction This is a brief Matlab tutorial for students who have not used Matlab in their programming. Matlab programming is essential in COMP61021 as a
More informationModels for Nurses: Quadratic Model ( ) Linear Model Dx ( ) x Models for Doctors:
The goal of this technology assignment is to graph several formulas in Excel. This assignment assumes that you using Excel 2007. The formula you will graph is a rational function formed from two polynomials,
More informationMatlab Tutorial. Get familiar with MATLAB by using tutorials and demos found in MATLAB. You can click Start MATLAB Demos to start the help screen.
University of Illinois at Urbana-Champaign Department of Electrical and Computer Engineering ECE 298JA Fall 2015 Matlab Tutorial 1 Overview The goal of this tutorial is to help you get familiar with MATLAB
More informationGetting Started in Matlab
Lesson 1: Getting Started in Matlab 1.1 Applied Problem. Heat transfer in a mass is very important for a number of objects such as cooling of electronic parts or the fabrication of large beams. Although
More informationLAB 1: Introduction to MATLAB Summer 2011
University of Illinois at Urbana-Champaign Department of Electrical and Computer Engineering ECE 311: Digital Signal Processing Lab Chandra Radhakrishnan Peter Kairouz LAB 1: Introduction to MATLAB Summer
More informationENGR Fall Exam 1
ENGR 13100 Fall 2012 Exam 1 INSTRUCTIONS: Duration: 60 minutes Keep your eyes on your own work! Keep your work covered at all times! 1. Each student is responsible for following directions. Read carefully.
More informationProgramming 1. Script files. help cd Example:
Programming Until now we worked with Matlab interactively, executing simple statements line by line, often reentering the same sequences of commands. Alternatively, we can store the Matlab input commands
More informationINTRODUCTION TO SAS STAT 525 FALL 2013
INTRODUCTION TO SAS STAT 525 FALL 2013 Statistical analyses, in practice, are always carried out by computer software In this class, I will focus on the use of SAS to perform these analyses, specifically
More informationPROGRAMMING WITH MATLAB DR. AHMET AKBULUT
PROGRAMMING WITH MATLAB DR. AHMET AKBULUT OVERVIEW WEEK 1 What is MATLAB? A powerful software tool: Scientific and engineering computations Signal processing Data analysis and visualization Physical system
More informationCan be put into the matrix form of Ax=b in this way:
Pre-Lab 0 Not for Grade! Getting Started with Matlab Introduction In EE311, a significant part of the class involves solving simultaneous equations. The most time efficient way to do this is through the
More information