Data and Function Plotting with MATLAB (Linux-10)

Size: px
Start display at page:

Download "Data and Function Plotting with MATLAB (Linux-10)"

Transcription

1 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 - see Appendix for plotting of fits file images.) Paste printouts of your plots into your lab notebook. A. Prerequisites. You must have completed the Login/GEdit tutorial and the MATLAB introduction tutorial. You should have created the files first.dat and firstplt.m already. B. Reference. Getting Started with MATLAB 7, Pratap. C. Introduction to MATLAB plotting. MATLAB can operate on data files to produce high quality plots with automatic scaling, labeled axes, titles, errorbars, and so forth. The plots can be proofed on the screen and then printed on the laser printer. You can work interactively with MATLAB plotting, and you can also store sets of commands in a "script", or ".m" file in order to easily repeat the same type of plot with different data sets. In the first computer tutorial you created a data file first.dat containing a sample set of x- and y- data values (plus y-uncertainties) to be plotted by MATLAB. You also created a script instruction file firstplt.m which tells MATLAB how to draw a particular plot with this data. We just need to start MATLAB and execute the script. To begin plotting, log in and open a terminal window as before, and then type matlab at the terminal command prompt (or click on the MATLAB icon if on a Windows computer). MATLAB should display a title screen and then indicate with its prompt >> that it is ready to receive commands. Now proceed to execute the script firstplt.m by just typing firstplt A graphics window should have appeared on the screen with the plot in it. If the plot is satisfactory, you can type print at the MATLAB command prompt to get a hard copy on the laser printer, or else select the print command from the print menu above the graph window. (If you get an error message saying that firstplt is an unknown command, or that first.dat cannot be found, it is because the files you created with Kedit or GEdit are not in MATLAB s Current Directory. The Current Directory is shown in a menu-window just above the command window; you can change the current directory with a cd directory at the MATLAB command line, or by using the browse button with three dots on it. You could also move your files into the standard MATLAB working directory. See Pratap Chap. 2 for more details.) Things to notice: The datapoints are plotted as points with y-errorbars and are not connected with line segments. Each axis has a label indicating what is plotted, with the units in parentheses. (This is theway data plots should always be done!) Look at the menu bar at the top of the figure window. Click on the data cursor icon and use the cursor to read out some of the data values from the plot. Under the tools menu, look at Data Statistics and also at Basic Fitting. Use Basic Fitting to fit a quadratic equation to the plotted data. You can also explore the Insert menu and try inserting an arrow on the plot. Remember to print off a copy of the plot from the File menu.

2 The Pratap book (or MATLAB Primer) shows some other MATLAB graphics commands that may be useful later on. Note that you can get the details of any command by typing help followed by the command name. You can also get general help by typing helpwin and using the menu structure. For your homework later on, you will want to use some of the following graphics commands: hist (y) hist(y,nb) hold on bar gtext('text') Creates a histogram of the values in the array y using 10 bins equally spaced between the minimum and maximum values of y. If you want a number nb of bins, use the command: Causes new plots to be superimposed on an existing plot Remember to use "hold off" when you are done superposing To create a bar graph Places text on the plot at a location you choose with the mouse Also, MATLAB text objects support a subset of TeX characters that enable you to use symbols and superscripts in axis labels or titles. For example, \alpha produces the Greek alpha character, and the string ^{-t} would cause -t to be a superscript. See the text function in the online MATLAB help for a list of available TeX characters. Note that you can overlay plots by using hold, reading in a new data file, and defining a new plot before erasing an old plot. This can be useful in plotting a theoretical curve over a set of experimental points, etc. (You need to be sure that the x- and y-axis ranges are compatible.) A script similar to firstplt.m can be written which will be useful for doing errorbar plots of any data file which has three columns representing the x,y, and y-errorbar values for each data point. I recommend that you prepare (using Gedit or, more conveniently, the built-in editor in MATLAB) a file (saved as eplot.m) as follows: datafile=input( Input the data file name, s ); data=load (datafile) x=data(:,1); y=data(:,2); e=data(:,3); errorbar(x,y,e,e,'*') After you run the script, you can add appropriate labels using the xlabel, ylabel, and title commands (look at the script firstplt.m to see how to use these commands. In creating a new data file to be plotted by eplot, make sure that it is an ASCII, or text, file and that it has three numbers per line (x, y, and delta-y, where delta-y is the uncertainty in the y value) separated by spaces. Also, be sure that the data file does not contain any blank lines, either before or after the data. Sometimes the editor program will jump to the next line for you and leave a blank line if you don't enter anything. If no errorbars are needed, you can enter zeros in the errorbar position, or much better, enter a small uncertainty estimate. As discussed in class, in some cases you will want to linearize a plot by plotting some function of the measured data on one of the axes. If you get your measured data into x, y, and e arrays, you can 2

3 transform the data for linearization by using commands such as y = y.*y (to transform each array element by squaring it), and to transform the y-uncertainty array with commands such as e = e./y. (Notice the use of dot operators!) Be sure to transform the uncertainty array before transforming data arrays (why?). To complete the tutorial, use MATLAB to plot data from one of the homework problems, such as a histogram of the data for a problem from Homework Set 2. D. User-Defined Functions and Plotting of Functions D1. - Function Definition. If you often do certain MATLAB calculations which involve a particular function that is not built in to MATLAB, you may want to write a MATLAB function definition. For example, here's a script file to define the function gssn (t,tmean,tstd), which calculates the Gaussian probability density for an input value of t when the mean is tmean and the standard deviation is tstd. You must use an editor to prepare and save the function definition below as an m-file with the name gssn.m function gs = gssn(t,tmean,tstd) gs = exp(-(t-tmean).^2/(2*tstd^2))/(tstd*(2*pi)^.5) If you wanted to compute the value of the integral of the Gaussian PDF from t=lowlimit to t=uplimit, you could use the quad function of MATLAB along with your function definition. It would go something like this (don t actually try this one, of course, since you would need values for the parameters ) y = quad( gssn,lowlimit,uplimit, 1e-3,[],Mean,StDev) For example, if you wanted to integrate a Gaussian with mean=0 and standard deviation = 2 from -2 to +2, you would write quad('gssn,-2,2, 1e-3,[],0,2) Try it - you should know what answer to expect! Put your prediction and result in the lab notebook. D2. Function Plotting To plot a function, you can define an "x" array of independent variable values (i.e., an array of arguments at which the function is to be evaluated) and a "y" array of function values at those x values. Here's an example with a Gaussian function with mean =5 and standard deviation = 1: x=0:.01:10; This generates a 1001 point array ranging from 0 to 10 in steps of 0.01 y=gssn(x,5,1); plot (x,y) xlabel ( Voltage (V) ) ylabel ( Probability Density (V^{-1}) ) Remember that you can superimpose this plot on a plot of experimental data by using the hold command. If doing so, you should be sure that the range of x (independent variable) values is the 3

4 same for both plots. Here, we used the plot command, which does connect the points with line segments, as is appropriate when plotting a theoretical curve. You should use this approach on the appropriate problem of Homework Set 2. Paste the plots from this session in your lab notebook along with a copy of your plotting script. E. PLOT1 for Linear Least-Squares Fits. The MATLAB script plot1 (the file is plot1.m) will take a file of x,y,delta-y data [i.e., a file with three columns of data: x, y, and delta-y, where delta-y is the uncertainty in the y-value] and perform a linear least-squares fit on it, provide the slope and intercept of the line and the uncertainties in these two parameters, and plot the data (with error bars) and the fitted line. The correlation coefficient and chi-squared values for the plot will be indicated (you will hear more about these parameters soon). Your data must be in a text, or character-type data file. (When you run the program, it will prompt you for the name of the data file to be plotted.) The file must have x in the first column, y in the second, and delta-y in the third. Use spaces to separate data fields, not tabs. Also, do not leave blank lines in the data file, either before or after the data. Data points will be plotted with y-errorbars, and the points will be weighted according to their uncertainty. Zeros in the delta-y column will probably cause an overflow; use small delta-y values if the actual delta-y values are unknown. The plot1.m file should be found in the Physics 710 directory [/Users/student/710/plot1.m]. You should copy it to your home directory or your MATLAB working directory so it will be available for you to use like your own.m files. To copy this file into your home directory, type in the following command at the UNIX command prompt: cp /Users/student/710/plot1.m plot1.m You can use your first.dat data file as a trial if you like (although those data do not fit a straight line all that well). You will need to use plot1 for one of the problems on homework set 3 and in many other situations during the course. You should also find it useful in your later work. If you need to linearize your data in order to make the dependent variable a linear function of the independent variable, you can write some lines of MATLAB code to transform the x-values and/or the y- and delta-y values as needed. One way to do this is to start with the plot1.m script, add the transformation lines (remember that MATLAB can transform a whole array with just one command!) between where the data is read in and where the plotting and fitting begin, and then save the script under a new file name (e.g., voltplot.m). It is best to NOT overwrite the original plot1.m file, so you always have it available as a starting point. Enjoy! 4

5 Appendix Plotting fits Images (FITS file and some material below courtesy Dr. Alberto Bolatto, Astronomy Dept., U. of Maryland) Astronomical image data is frequently saved in the FITS (Flexible Image Transport System) format. FITS files, which MATLAB can read and display, have two parts: a header section (which has information about when and how the data were obtained, coordinate systems, units, etc.) and a data section (the raw image data, stored as binary numbers). The MATLAB command fitsread will read the primary image data of a FITS file. For example, the command idata = fitsread(filename); would put the image data from fits file filename into the matrix idata. The filename argument is a string enclosed in single quotes, like M83.fits If you would like to try this, copy the file n4254_pr.fits from the 710 directory in the same way that you copied the plot1.m script (from the UNIX command line, you would enter cp /Users/student/710/n4254_pr.fits n4254_pr.fits ). Then try the following commands idata = fitsread( n4254_pr.fits ); imagesc(idata) axis image set(gca, ydir, nor ) to read in a FITS image of NGC 4254 (M99) into MATLAB, display it as an image, format the axes so that it displays square pixels, and orient it properly so that right is West and up is North. A useful image manipulation is to change the range of intensities in the display using the MATLAB caxis command. Try caxis([ ]) which should let you see the details of the outer spiral arms at the cost of saturating the nucleus. Too see the nucleus and spiral arms at the same time, you could display the logarithm of the intensity values as follows: imagesc(log(idata )); caxis ([ ]} 5

Fitting data with Matlab

Fitting 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 information

Lab1: Use of Word and Excel

Lab1: Use of Word and Excel Dr. Fritz Wilhelm; physics 230 Lab1: Use of Word and Excel Page 1 of 9 Lab partners: Download this page onto your computer. Also download the template file which you can use whenever you start your lab

More information

APPM 2460 PLOTTING IN MATLAB

APPM 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 information

Grace days can not be used for this assignment

Grace 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 information

Name: Dr. Fritz Wilhelm Lab 1, Presentation of lab reports Page # 1 of 7 5/17/2012 Physics 120 Section: ####

Name: Dr. Fritz Wilhelm Lab 1, Presentation of lab reports Page # 1 of 7 5/17/2012 Physics 120 Section: #### Name: Dr. Fritz Wilhelm Lab 1, Presentation of lab reports Page # 1 of 7 Lab partners: Lab#1 Presentation of lab reports The first thing we do is to create page headers. In Word 2007 do the following:

More information

To Plot a Graph in Origin. Example: Number of Counts from a Geiger- Müller Tube as a Function of Supply Voltage

To Plot a Graph in Origin. Example: Number of Counts from a Geiger- Müller Tube as a Function of Supply Voltage To Plot a Graph in Origin Example: Number of Counts from a Geiger- Müller Tube as a Function of Supply Voltage 1 Digression on Error Bars What entity do you use for the magnitude of the error bars? Standard

More information

Desktop Command window

Desktop 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 information

MATLAB INTRODUCTION. Matlab can be used interactively as a super hand calculator, or, more powerfully, run using scripts (i.e., programs).

MATLAB INTRODUCTION. Matlab can be used interactively as a super hand calculator, or, more powerfully, run using scripts (i.e., programs). L A B 6 M A T L A B MATLAB INTRODUCTION Matlab is a commercial product that is used widely by students and faculty and researchers at UTEP. It provides a "high-level" programming environment for computing

More information

Administrivia. Next Monday is Thanksgiving holiday. Tuesday and Wednesday the lab will be open for make-up labs. Lecture as usual on Thursday.

Administrivia. Next Monday is Thanksgiving holiday. Tuesday and Wednesday the lab will be open for make-up labs. Lecture as usual on Thursday. Administrivia Next Monday is Thanksgiving holiday. Tuesday and Wednesday the lab will be open for make-up labs. Lecture as usual on Thursday. Lab notebooks will be due the week after Thanksgiving, when

More information

An introduction to plotting data

An introduction to plotting data An introduction to plotting data Eric D. Black California Institute of Technology February 25, 2014 1 Introduction Plotting data is one of the essential skills every scientist must have. We use it on a

More information

Appendix A. Introduction to MATLAB. A.1 What Is MATLAB?

Appendix 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 information

Microsoft Word for Report-Writing (2016 Version)

Microsoft Word for Report-Writing (2016 Version) Microsoft Word for Report-Writing (2016 Version) Microsoft Word is a versatile, widely-used tool for producing presentation-quality documents. Most students are well-acquainted with the program for generating

More information

MATLAB Project: Getting Started with MATLAB

MATLAB 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 information

Getting Started. Chapter 1. How to Get Matlab. 1.1 Before We Begin Matlab to Accompany Lay s Linear Algebra Text

Getting 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 information

A Guide to Using Some Basic MATLAB Functions

A 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 information

Introduction 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 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 information

Excel Spreadsheets and Graphs

Excel Spreadsheets and Graphs Excel Spreadsheets and Graphs Spreadsheets are useful for making tables and graphs and for doing repeated calculations on a set of data. A blank spreadsheet consists of a number of cells (just blank spaces

More information

ENVI Tutorial: Introduction to ENVI

ENVI Tutorial: Introduction to ENVI ENVI Tutorial: Introduction to ENVI Table of Contents OVERVIEW OF THIS TUTORIAL...1 GETTING STARTED WITH ENVI...1 Starting ENVI...1 Starting ENVI on Windows Machines...1 Starting ENVI in UNIX...1 Starting

More information

1 Introduction to Matlab

1 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 information

MATLAB - Lecture # 4

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 information

Creates 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.

Creates 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 information

MATLAB Introduction to MATLAB Programming

MATLAB 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 information

MATLAB Introductory Course Computer Exercise Session

MATLAB 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 information

Matlab Tutorial 1: Working with variables, arrays, and plotting

Matlab 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 information

0 Graphical Analysis Use of Excel

0 Graphical Analysis Use of Excel Lab 0 Graphical Analysis Use of Excel What You Need To Know: This lab is to familiarize you with the graphing ability of excels. You will be plotting data set, curve fitting and using error bars on the

More information

A quick Matlab tutorial

A quick Matlab tutorial A quick Matlab tutorial Michael Robinson 1 Introduction In this course, we will be using MATLAB for computer-based matrix computations. MATLAB is a programming language/environment that provides easy access

More information

Introduction to Spreadsheets

Introduction to Spreadsheets Introduction to Spreadsheets Spreadsheets are computer programs that were designed for use in business. However, scientists quickly saw how useful they could be for analyzing data. As the programs have

More information

MATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c.

MATLAB 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 information

STAT 391 Handout 1 Making Plots with Matlab Mar 26, 2006

STAT 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 information

Pre-Lab Excel Problem

Pre-Lab Excel Problem Pre-Lab Excel Problem Read and follow the instructions carefully! Below you are given a problem which you are to solve using Excel. If you have not used the Excel spreadsheet a limited tutorial is given

More information

Exercise: Graphing and Least Squares Fitting in Quattro Pro

Exercise: Graphing and Least Squares Fitting in Quattro Pro Chapter 5 Exercise: Graphing and Least Squares Fitting in Quattro Pro 5.1 Purpose The purpose of this experiment is to become familiar with using Quattro Pro to produce graphs and analyze graphical data.

More information

What is MATLAB and howtostart it up?

What is MATLAB and howtostart it up? MAT rix LABoratory What is MATLAB and howtostart it up? Object-oriented high-level interactive software package for scientific and engineering numerical computations Enables easy manipulation of matrix

More information

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER BENC 2113 DENC ECADD 2532 ECADD LAB SESSION 6/7 LAB

More information

AMATH 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 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 information

Experimental Physics I & II "Junior Lab"

Experimental Physics I & II Junior Lab MIT OpenCourseWare http://ocw.mit.edu 8.13-14 Experimental Physics I & II "Junior Lab" Fall 2007 - Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

AMS 27L LAB #2 Winter 2009

AMS 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 information

= 3 + (5*4) + (1/2)*(4/2)^2.

= 3 + (5*4) + (1/2)*(4/2)^2. Physics 100 Lab 1: Use of a Spreadsheet to Analyze Data by Kenneth Hahn and Michael Goggin In this lab you will learn how to enter data into a spreadsheet and to manipulate the data in meaningful ways.

More information

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables Jennie Murack You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables How to conduct basic descriptive statistics

More information

Assignment 2 in Simulation of Telesystems Laboratory exercise: Introduction to Simulink and Communications Blockset

Assignment 2 in Simulation of Telesystems Laboratory exercise: Introduction to Simulink and Communications Blockset Mid Sweden University Revised: 2013-11-12 Magnus Eriksson Assignment 2 in Simulation of Telesystems Laboratory exercise: Introduction to Simulink and Communications Blockset You are expected to conclude

More information

Computer Data Analysis and Use of Excel

Computer Data Analysis and Use of Excel Computer Data Analysis and Use o Excel I. Theory In this lab we will use Microsot EXCEL to do our calculations and error analysis. This program was written primarily or use by the business community, so

More information

Introduction to Motion

Introduction to Motion Date Partners Objectives: Introduction to Motion To investigate how motion appears on a position versus time graph To investigate how motion appears on a velocity versus time graph and the relationship

More information

Part I. Introduction to Linux

Part I. Introduction to Linux Part I Introduction to Linux 7 Chapter 1 Linux operating system Goal-of-the-Day Familiarisation with basic Linux commands and creation of data plots. 1.1 What is Linux? All astronomical data processing

More information

Chapter 3: Rate Laws Excel Tutorial on Fitting logarithmic data

Chapter 3: Rate Laws Excel Tutorial on Fitting logarithmic data Chapter 3: Rate Laws Excel Tutorial on Fitting logarithmic data The following table shows the raw data which you need to fit to an appropriate equation k (s -1 ) T (K) 0.00043 312.5 0.00103 318.47 0.0018

More information

EGR 111 Plotting Data

EGR 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 information

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017 Einführung in die Programmierung für Physiker WS 207/208 Marc Wagner Francesca Cuteri: cuteri@th.physik.uni-frankfurt.de Alessandro Sciarra: sciarra@th.physik.uni-frankfurt.de Exercise sheet To be corrected

More information

Excel Primer CH141 Fall, 2017

Excel Primer CH141 Fall, 2017 Excel Primer CH141 Fall, 2017 To Start Excel : Click on the Excel icon found in the lower menu dock. Once Excel Workbook Gallery opens double click on Excel Workbook. A blank workbook page should appear

More information

Objectives. 1 Basic Calculations. 2 Matrix Algebra. Physical Sciences 12a Lab 0 Spring 2016

Objectives. 1 Basic Calculations. 2 Matrix Algebra. Physical Sciences 12a Lab 0 Spring 2016 Physical Sciences 12a Lab 0 Spring 2016 Objectives This lab is a tutorial designed to a very quick overview of some of the numerical skills that you ll need to get started in this class. It is meant to

More information

Experimental Design and Graphical Analysis of Data

Experimental Design and Graphical Analysis of Data Experimental Design and Graphical Analysis of Data A. Designing a controlled experiment When scientists set up experiments they often attempt to determine how a given variable affects another variable.

More information

Plotting Graphs. Error Bars

Plotting Graphs. Error Bars E Plotting Graphs Construct your graphs in Excel using the method outlined in the Graphing and Error Analysis lab (in the Phys 124/144/130 laboratory manual). Always choose the x-y scatter plot. Number

More information

Section 4.4: Parabolas

Section 4.4: Parabolas Objective: Graph parabolas using the vertex, x-intercepts, and y-intercept. Just as the graph of a linear equation y mx b can be drawn, the graph of a quadratic equation y ax bx c can be drawn. The graph

More information

Week 1: Introduction to R, part 1

Week 1: Introduction to R, part 1 Week 1: Introduction to R, part 1 Goals Learning how to start with R and RStudio Use the command line Use functions in R Learning the Tools What is R? What is RStudio? Getting started R is a computer program

More information

An SM tutorial for programming and plotting

An SM tutorial for programming and plotting An SM tutorial for programming and plotting Gary Mamon January 2, 2014 1 Introduction SM (a.k.a. SuperMongo), written by Robert Lupton, is advertised by its author as a graphics language. In fact, SM is

More information

Using the Zoo Workstations

Using the Zoo Workstations Using the Zoo Workstations Version 1.86: January 16, 2014 If you ve used Linux before, you can probably skip many of these instructions, but skim just in case. Please direct corrections and suggestions

More information

Introduction to the MATLAB SIMULINK Program

Introduction 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 information

Capstone Appendix. A guide to your lab computer software

Capstone Appendix. A guide to your lab computer software Capstone Appendix A guide to your lab computer software Important Notes Many of the Images will look slightly different from what you will see in lab. This is because each lab setup is different and so

More information

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX 1) Objective The objective of this lab is to review how to access Matlab, Simulink, and the Communications Toolbox, and to become familiar

More information

Getting Started With Linux and Fortran Part 2

Getting Started With Linux and Fortran Part 2 Getting Started With Linux and Fortran Part 2 by Simon Campbell [The K Desktop Environment, one of the many desktops available for Linux] ASP 3012 (Stars) Computer Tutorial 2 1 Contents 1 Some Funky Linux

More information

Activity Graphical Analysis with Excel and Logger Pro

Activity Graphical Analysis with Excel and Logger Pro Activity Graphical Analysis with Excel and Logger Pro Purpose Vernier s Logger Pro is a graphical analysis software that will allow you to collect, graph and manipulate data. Microsoft s Excel is a spreadsheet

More information

The value of f(t) at t = 0 is the first element of the vector and is obtained by

The value of f(t) at t = 0 is the first element of the vector and is obtained by MATLAB Tutorial This tutorial will give an overview of MATLAB commands and functions that you will need in ECE 366. 1. Getting Started: Your first job is to make a directory to save your work in. Unix

More information

ENVI Classic Tutorial: Introduction to ENVI Classic 2

ENVI Classic Tutorial: Introduction to ENVI Classic 2 ENVI Classic Tutorial: Introduction to ENVI Classic Introduction to ENVI Classic 2 Files Used in This Tutorial 2 Getting Started with ENVI Classic 3 Loading a Gray Scale Image 3 ENVI Classic File Formats

More information

MATLAB Project: Getting Started with MATLAB

MATLAB 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 information

GRAPHICS AND VISUALISATION WITH MATLAB

GRAPHICS AND VISUALISATION WITH MATLAB GRAPHICS AND VISUALISATION WITH MATLAB UNIVERSITY OF SHEFFIELD CiCS DEPARTMENT Des Ryan & Mike Griffiths September 2017 Topics 2D Graphics 3D Graphics Displaying Bit-Mapped Images Graphics with Matlab

More information

Introduction to Stata. Getting Started. This is the simple command syntax in Stata and more conditions can be added as shown in the examples.

Introduction to Stata. Getting Started. This is the simple command syntax in Stata and more conditions can be added as shown in the examples. Getting Started Command Syntax command varlist, option This is the simple command syntax in Stata and more conditions can be added as shown in the examples. Preamble mkdir tutorial /* to create a new directory,

More information

Physics 101, Lab 1: LINEAR KINEMATICS PREDICTION SHEET

Physics 101, Lab 1: LINEAR KINEMATICS PREDICTION SHEET Physics 101, Lab 1: LINEAR KINEMATICS PREDICTION SHEET After reading through the Introduction, Purpose and Principles sections of the lab manual (and skimming through the procedures), answer the following

More information

Logger Pro Resource Sheet

Logger Pro Resource Sheet Logger Pro Resource Sheet Entering and Editing Data Data Collection How to Begin How to Store Multiple Runs Data Analysis How to Scale a Graph How to Determine the X- and Y- Data Points on a Graph How

More information

Objectives. 1 Running, and Interface Layout. 2 Toolboxes, Documentation and Tutorials. 3 Basic Calculations. PS 12a Laboratory 1 Spring 2014

Objectives. 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 information

CSE/NEUBEH 528 Homework 0: Introduction to Matlab

CSE/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 information

INSTRUCTIONS FOR USING MICROSOFT EXCEL PERFORMING DESCRIPTIVE AND INFERENTIAL STATISTICS AND GRAPHING

INSTRUCTIONS FOR USING MICROSOFT EXCEL PERFORMING DESCRIPTIVE AND INFERENTIAL STATISTICS AND GRAPHING APPENDIX INSTRUCTIONS FOR USING MICROSOFT EXCEL PERFORMING DESCRIPTIVE AND INFERENTIAL STATISTICS AND GRAPHING (Developed by Dr. Dale Vogelien, Kennesaw State University) ** For a good review of basic

More information

Matlab Tutorial: Basics

Matlab Tutorial: Basics Matlab Tutorial: Basics Topics: opening matlab m-files general syntax plotting function files loops GETTING HELP Matlab is a program which allows you to manipulate, analyze and visualize data. MATLAB allows

More information

Introduction to Unix and Matlab

Introduction to Unix and Matlab Introduction to Unix and Matlab 1 Introduction to the Unix System 1.1 Login Pick any machine in Room 451; the screen is probably dark. If so, press the [return] key once or twice. You should see something

More information

Getting Started with MATLAB

Getting Started with MATLAB Getting Started with MATLAB Math 315, Fall 2003 Matlab is an interactive system for numerical computations. It is widely used in universities and industry, and has many advantages over languages such as

More information

Lab 1- Introduction to Motion

Lab 1- Introduction to Motion Partner : Purpose Partner 2: Lab - Section: The purpose of this lab is to learn via a motion detector the relationship between position and velocity. Remember that this device measures the position of

More information

Lab 5: Program Control and Functions

Lab 5: Program Control and Functions EGR 53L - Spring 2010 Lab 5: Program Control and Functions 5.1 Introduction Lab this week is going to focus on structured programming, specifically using logic and selective structures to control program

More information

Introduction to MatLab. Introduction to MatLab K. Craig 1

Introduction to MatLab. Introduction to MatLab K. Craig 1 Introduction to MatLab Introduction to MatLab K. Craig 1 MatLab Introduction MatLab and the MatLab Environment Numerical Calculations Basic Plotting and Graphics Matrix Computations and Solving Equations

More information

Getting To Know Matlab

Getting To Know Matlab Getting To Know Matlab The following worksheets will introduce Matlab to the new user. Please, be sure you really know each step of the lab you performed, even if you are asking a friend who has a better

More information

Introduction to Computer Graphics and Computer Vision Assignment 3: Due 7/27/2015

Introduction to Computer Graphics and Computer Vision Assignment 3: Due 7/27/2015 Introduction to Computer Graphics and Computer Vision Assignment 3: Due 7/27/2015 Nicholas Dwork For this assignment, don t submit any printouts of images. If you want to turn in some answers handwritten,

More information

Error Analysis, Statistics and Graphing

Error Analysis, Statistics and Graphing Error Analysis, Statistics and Graphing This semester, most of labs we require us to calculate a numerical answer based on the data we obtain. A hard question to answer in most cases is how good is your

More information

A Simple First-Model Using the Berkeley-Madonna Program

A Simple First-Model Using the Berkeley-Madonna Program A Simple First-Model Using the Berkeley-Madonna Program For this introduction, we will be creating a model of a simple system with two compartments analogous to containers of a liquid which can flow between

More information

ENVI Tutorial: Interactive Display Functions

ENVI Tutorial: Interactive Display Functions ENVI Tutorial: Interactive Display Functions Table of Contents OVERVIEW OF THIS TUTORIAL...2 OPENING A PANCHROMATIC (SPOT) IMAGE FILE...2 PERFORMING INTERACTIVE CONTRAST STRETCHING...2 Linear Stretching

More information

Data Management Project Using Software to Carry Out Data Analysis Tasks

Data Management Project Using Software to Carry Out Data Analysis Tasks Data Management Project Using Software to Carry Out Data Analysis Tasks This activity involves two parts: Part A deals with finding values for: Mean, Median, Mode, Range, Standard Deviation, Max and Min

More information

Introduction to Matlab

Introduction 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 information

For the SIA Features of GigaView. Introduction. Initial Dialog Bar

For the SIA Features of GigaView. Introduction. Initial Dialog Bar For the SIA-3000 Features of GigaView One button solution for multiple DataCom compliant standards jitter testing. Comprehensive and versatile jitter analysis software enables users to quickly understand

More information

Computational Approach to Materials Science and Engineering

Computational Approach to Materials Science and Engineering Computational Approach to Materials Science and Engineering Prita Pant and M. P. Gururajan January, 2012 Copyright c 2012, Prita Pant and M P Gururajan. Permission is granted to copy, distribute and/or

More information

Introduction to Minitab 1

Introduction to Minitab 1 Introduction to Minitab 1 We begin by first starting Minitab. You may choose to either 1. click on the Minitab icon in the corner of your screen 2. go to the lower left and hit Start, then from All Programs,

More information

SPSS 11.5 for Windows Assignment 2

SPSS 11.5 for Windows Assignment 2 1 SPSS 11.5 for Windows Assignment 2 Material covered: Generating frequency distributions and descriptive statistics, converting raw scores to standard scores, creating variables using the Compute option,

More information

Getting Started with MATLAB

Getting Started with MATLAB Getting Started with MATLAB Math 4600 Lab: Gregory Handy http://www.math.utah.edu/ borisyuk/4600/ Logging in for the first time: This is what you do to start working on the computer. If your machine seems

More information

Getting Started With UNIX Lab Exercises

Getting Started With UNIX Lab Exercises Getting Started With UNIX Lab Exercises This is the lab exercise handout for the Getting Started with UNIX tutorial. The exercises provide hands-on experience with the topics discussed in the tutorial.

More information

A brief Tutorial of the CLASS Data Reduction Program

A brief Tutorial of the CLASS Data Reduction Program A brief Tutorial of the CLASS Data Reduction Program While running a Spectral-line observing session (especially a longer session involving mapping or many observations), it might be desirable to conduct

More information

Dr. Barbara Morgan Quantitative Methods

Dr. Barbara Morgan Quantitative Methods Dr. Barbara Morgan Quantitative Methods 195.650 Basic Stata This is a brief guide to using the most basic operations in Stata. Stata also has an on-line tutorial. At the initial prompt type tutorial. In

More information

MATLAB Tutorial. Primary Author: Shoumik Chatterjee Secondary Author: Dr. Chuan Li

MATLAB 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 information

Laboratory 1 Octave Tutorial

Laboratory 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 information

Experiment 1 CH Fall 2004 INTRODUCTION TO SPREADSHEETS

Experiment 1 CH Fall 2004 INTRODUCTION TO SPREADSHEETS Experiment 1 CH 222 - Fall 2004 INTRODUCTION TO SPREADSHEETS Introduction Spreadsheets are valuable tools utilized in a variety of fields. They can be used for tasks as simple as adding or subtracting

More information

Introduction to MATLAB

Introduction to MATLAB UNIVERSITY OF CHICAGO Booth School of Business Bus 35120 Portfolio Management Prof. Lubos Pastor Introduction to MATLAB The purpose of this note is to help you get acquainted with the basics of Matlab.

More information

Department 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 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 information

Introduction to IgorPro

Introduction to IgorPro Introduction to IgorPro These notes provide an introduction to the software package IgorPro. For more details, see the Help section or the IgorPro online manual. [www.wavemetrics.com/products/igorpro/manual.htm]

More information

EE168 Lab/Homework #1 Introduction to Digital Image Processing Handout #3

EE168 Lab/Homework #1 Introduction to Digital Image Processing Handout #3 EE168 Lab/Homework #1 Introduction to Digital Image Processing Handout #3 We will be combining laboratory exercises with homework problems in the lab sessions for this course. In the scheduled lab times,

More information

Lab 1 Introduction to R

Lab 1 Introduction to R Lab 1 Introduction to R Date: August 23, 2011 Assignment and Report Due Date: August 30, 2011 Goal: The purpose of this lab is to get R running on your machines and to get you familiar with the basics

More information

Microsoft Excel Using Excel in the Science Classroom

Microsoft Excel Using Excel in the Science Classroom Microsoft Excel Using Excel in the Science Classroom OBJECTIVE Students will take data and use an Excel spreadsheet to manipulate the information. This will include creating graphs, manipulating data,

More information

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips Cal Poly San Luis Obispo Mechanical Engineering ME Mechanical Control Systems Matlab/Simulink Hints and Tips Ridgely/Owen, last update Jan Building A Model The way in which we construct models for analyzing

More information

Eric W. Hansen. The basic data type is a matrix This is the basic paradigm for computation with MATLAB, and the key to its power. Here s an example:

Eric W. Hansen. The basic data type is a matrix This is the basic paradigm for computation with MATLAB, and the key to its power. Here s an example: Using MATLAB for Stochastic Simulation. Eric W. Hansen. Matlab Basics Introduction MATLAB (MATrix LABoratory) is a software package designed for efficient, reliable numerical computing. Using MATLAB greatly

More information