Computational Approach to Materials Science and Engineering

Size: px
Start display at page:

Download "Computational Approach to Materials Science and Engineering"

Transcription

1 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 modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back- Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. 1

2 Module: gnuplot the plotting freeware gnuplot is a freeware, primarily used for visualization of data, that is, plotting. Typically, the data used for plotting could be experimental, or generated on a computer using a programming language; gnuplot itself can also generate simple data for plotting. In this chapter, we give a tutorial introductions to working with gnuplot. For further information, we recommend the reader to peruse some of the links listed in the references below. A note: In these notes, sometimes, when the information on the gnuplot terminal is too long to be shown verbatim, we have used two backslashes (\\) to identify the line break introduced by us. 1 Working with gnuplot 1.1 Invoking gnuplot Open a terminal. Type gnuplot and Enter. You will get the following message and prompt. G N U P L O T Version 4.2 patchlevel 6 last modified Sep 2009 System: Linux generic Copyright (C) , 1998, 2004, Thomas Williams, Colin Kelley and many others Type help to access the on-line reference manual. The gnuplot FAQ is available from Send bug reports and suggestions to \\ < 2

3 Terminal type set to wxt gnuplot> 1.2 Getting help Type help in the gnuplot prompt and Enter. You get the following information. gnuplot> help gnuplot is a command-driven interactive function and data plotting \\ program. Any command-line arguments are assumed to be names of files containing gnuplot commands, with the exception of standard X11 arguments, which \\ are processed first. Each file is loaded with the load command, in the \\ order specified. gnuplot exits after the last file is processed. The \\ special filename "-" is used to denote standard input. When no load files \\ are named, gnuplot enters into an interactive mode. See help for \\ batch/interactive for more details. gnuplot is case sensitive (commands and function names written \\ in lowercase are not the same as those written in CAPS). All command names \\ may be abbreviated as long as the abbreviation is not ambiguous. Any \\ number of commands may appear on a line (with the exception that \\ load or call must be the final command), separated by semicolons (;). \\ Strings are indicated with quotes. They may be either single or double quotation \\ 3

4 marks, e.g., load "filename" cd dir although there are some subtle differences \\ (see syntax for more details). Press return for more: You can continue with reading more information on gnuplot using the Enter keystroke. After all the information is shown, you get the gnuplot> prompt back. This help page also lists all the topics on which help is available. For example, if you need help on colornames, typing help colornames followed by the Enter keystroke on the gnuplot prompt gets you the relevant information. gnuplot> help colornames Gnuplot knows a limited number of color names. You can use these to define the color range spanned by a pm3d palette, or to assign a terminal-independent color to a particular linetype or linestyle. To see the list of known color names, use the command show palette colornames. See set palette, linestyle. gnuplot> 1.3 Testing Typing test on the gnuplot prompt gets a gnuplot test window as shown below. 4

5 Figure1: Thetestwindowthatpopsupontypingtestatthegnuplotprompt. 1.4 Modes of working One can work with gnuplot in two modes. The first is the interactive mode; in this mode, we can keep giving commands to gnuplot and it executes them immediately. On the other hand, it is also possible to run it the script mode; in this mode, all the commands are kept in a file and the processing starts with the load command: load "./test.plt" As noted above, the typical script file is given an extension of.plt Plotting sin(x) in interactive mode Plotting a function in interactive mode is very easy. All you need to do is to type plot sin(x) at the gnuplot prompt. The plot generated is shown in the Figure. 2. 5

6 Figure 2: The plot of sin(x). 6

7 gnuplot also allows the use of abbreviations; for example, p sin(x), pl sin(x), and plo sin(x) are all equivalent to plot sin(x) and produce the same result; as long as the abbreviation is unambiguous (that is, the abbreviation can uniquely identify a single gnuplot command) it would work Plotting sin(x) using a script file If we write all the gnuplot commands in a file (say, filename.plt), we can use the command load "filename.plt" at the gnuplot command prompt and obtain the same effect. Here is the file for plotting sin(x); note that gnuplot identifies comments by the use of the # symbol. In data files too, we can use # to write information about data for a human reader; gnuplot would disregard these lines while plotting. # This is a comment! Plotting sin(x) with gnuplot plot sin(x) 1.5 Plotting more than one curve in the same figure The following script, for example, plots sin(x) and cos(x) in the same figure, with lines and points; the sin(x) is plotted with filled circles while cos(x) is plotted with filled squares. In addition, the script also shows how to do the following: Make the plot square; Set the x-range (from 0 to 2π, in this case); Set the y-range (from -1.1 to 1.1, in this case); Label the x- and y-axes; and, Give a title to the plot. 7

8 # Plotting sin(x) and cos(x) in the same figure # Let us make the plot window square set size ratio 1.0 # Let us fix the x-range set xrange[0:2*pi] # Let us fix the y-range set yrange[-1.1:1.1] # Let us label the x-axis set xlabel "x" # Let us label the y-axis set ylabel "The trigomometric function" # Let us give a caption to the plot set title "Cos and Sin" # Let us plot sin(x) with lines and points; the points are filled circles # Let us plot cos(x) with lines and points; the points are filled squares # Note that no line break is allowed; if we want a line break, that should # be preceded by a single backslash plot sin(x) with linespoints pointtype 7, cos(x) with linespoints \ pointtype 5 The figure generated by gnuplot is shown in Figure. 3. 8

9 Figure 3: The plot of sin(x) and cos(x) in the same figure. 9

10 1.6 Plotting vectors It is possible to plot curves with arrows. In Figure. 4, for example, sin(x) plotted with arrow heads using the command: plot sin(x) with vectors heads,sin(x) Figure 4: The plot of sin(x) with arrow heads. 1.7 Plotting data from files In this section, we show how to plot data storied in a file. Let us consider the data files grainsize10kpers.dat, grainsize100kpers.dat and grainsize1000kpers.dat. They are as given below: grainsize10kpers.dat 10

11 # Grain size data at heating rate of 10 K/s # The first column is the peak temperature (K) # The second column is the Mean Volumetric Grain Size (in microns) # The Third column is the standard deviation # The fourth column is the number of grains # The data is from Kumkum Banerjee, Matthias Millitzer, # Michel Perez, and Xiang Wang, Nonisothermal austenite # grain growth kinetics in a microalloyed X80 linepipe # steel, Metallurgical and Materials Transactions A, # Vol. 41, No. 12, pp , December grainsize100kpers.dat # Grain size data at heating rate of 100 K/s # The first column is the peak temperature (K) # The second column is the Mean Volumetric Grain Size (in microns) # The Third column is the standard deviation # The fourth column is the number of grains # The data is from Kumkum Banerjee, Matthias Millitzer, # Michel Perez, and Xiang Wang, Nonisothermal austenite # grain growth kinetics in a microalloyed X80 linepipe # steel, Metallurgical and Materials Transactions A, # Vol. 41, No. 12, pp , December grainsize1000kpers.dat # Grain size data at heating rate of 1000 K/s # The first column is the peak temperature (K) # The second column is the Mean Volumetric Grain Size (in microns) 11

12 # The Third column is the standard deviation # The fourth column is the number of grains # The data is from Kumkum Banerjee, Matthias Millitzer, # Michel Perez, and Xiang Wang, Nonisothermal austenite # grain growth kinetics in a microalloyed X80 linepipe # steel, Metallurgical and Materials Transactions A, # Vol. 41, No. 12, pp , December It is possible to plot these data from gnuplot using the plot command. For example, plot "grainsize10kpers.dat" produces the plot as shown in Figure. 5. Figure 5: The plot of grain size versus temperature 12

13 The first thing to notice is that gnuplot ignores lines that start with the (#) symbol; hence, it is easy to incorporate all the relevant information about the data for a human reader but make gnuplot ignore the same. The second aspect is that simple plot tells gnuplot to plot the first two columns of the data with the first column being the x-axis and the second being the y-axis. We can get a plot with labeled axes and appropriate title by executing the following script. We also draw a line through the data points as a guide to the eye. The resultant plot is shown in Figure. 6. set xlabel "Temperature (in K)" set ylabel "Grain size (in microns)" plot "grainsize10kpers.dat" with linespoints title "Heating rate: 10 K/s" Figure 6: The plot of grain size versus temperature, with labeled axes and a line drawn as a guide to the eye. 13

14 1.8 Plotting with error bars Most of the times, the experimental data is typically given along with the errorbars; the current data is no exception and the error is given as standard deviation in column 3 of the data files. It is possible to plot the data with the error bars. Here is a script that would do that. The resultant plot is shown in Figure. 7 set xlabel "Temperature (in K)" set ylabel "Grain size (in microns)" plot "grainsize10kpers.dat" with linespoints \ title "Heating rate: 10 K/s", "grainsize10kpers.dat" \ using 1:2:3 with yerrorbar notitle Figure 7: The plot of grain size versus temperature; the data is plotted with errobars. 14

15 1.9 Plotting specific columns of the data Suppose we wanted to plot the peak temperature and the number of grains. That is, in the data file, we want to plot the colmuns 1 and 4. This can be done using the script shown below. The resultant plot is shown in Figure. 8. set xlabel "Temperature (in K)" set ylabel "No of grains" plot "grainsize10kpers.dat" using 1:4 with linespoints \ title "Heating rate: 10 K/s" Figure 8: The plot of grain size versus temperature; the data is plotted with errobars. 15

16 1.10 Plotting data from more than one file Of course, it is possible to plot data from different data files in the same plot. Here is a script that plots data for all the three heating rates. The resulting plot is shown in Figure. 9. set xlabel "Temperature (in K)" set ylabel "Grain size (in microns)" plot "grainsize10kpers.dat" with linespoints \ title "Heating rate: 10 K/s", "grainsize10kpers.dat" \ using 1:2:3 with yerrorbar notitle, \ "grainsize100kpers.dat" with linespoints \ title "Heating rate: 100 K/s", "grainsize100kpers.dat" \ using 1:2:3 with yerrorbar notitle, \ "grainsize1000kpers.dat" with linespoints \ title "Heating rate: 1000 K/s", "grainsize1000kpers.dat" \ using 1:2:3 with yerrorbar notitle 1.11 Shifting legends We see that the legends are on the right hand side and hence are getting printed on top of the plot itself in Figure. 9. To avoid that, we can use the command set key left top, which generates a plot as shown in Figure. 10. The script that generated the figure is also given below for reference. set key left top set xlabel "Temperature (in K)" set ylabel "Grain size (in microns)" plot "grainsize10kpers.dat" with linespoints \ title "Heating rate: 10 K/s", "grainsize10kpers.dat" \ using 1:2:3 with yerrorbar notitle, \ "grainsize100kpers.dat" with linespoints \ title "Heating rate: 100 K/s", "grainsize100kpers.dat" \ using 1:2:3 with yerrorbar notitle, \ "grainsize1000kpers.dat" with linespoints \ 16

17 Figure 9: The plot of grain size versus temperature for various heating rates. 17

18 title "Heating rate: 1000 K/s", "grainsize1000kpers.dat" \ using 1:2:3 with yerrorbar notitle Figure 10: The plot of grain size versus temperature for various heating rates. The legend is shifted from its default position at right top to left top Setting line widths Let us say we want to make the plots and the axes boxes thicker than the default. It can be done using the linewidth command as shown in the script below. The figure generated using the script is shown in Figure. 11. set size ratio 1.0 set border linewidth 4 plot sin(x) with lines linewidth 2 notitle 18

19 Figure 11: The plot of sin(x) with thicker border and thicker lines for the plot. 19

20 1.13 Saving figures Finally, the generated figures can be saved using the set terminal type command. As an example, we show how to plot and save a figure. The resultant figure is shown in Figure. 12 set term postscript enhanced color set size ratio 1.0 set border linewidth 4 set output "tanx.eps" plot tan(x) with lines linewidth 2 notitle set term wxt replot D plots and contours The following set of commands produce the plot of exp( (x 2 + y 2 )) shown in Figure 13. set xrange[-2:2] set yrange[-2:2] f(x,y) = exp(-x*x-y*y) splot f(x,y) The command set isosamples increases the density of grid lines on the surface; in Figure. 14 we show the plot of exp( (x 2 +y 2 )) with denser isolines generated using the following script. set xrange[-2:2] set yrange[-2:2] set isosamples 41,41 f(x,y) = exp(-x*x-y*y) splot f(x,y) 20

21 Figure12: The plot of tan(x). The figure was generated in gnuplot and saved (as compared to the other figures in this chapter which were captured from the screen and saved). 21

22 Figure 13: The 3D plot of exp( (x 2 +y 2 )) Figure 14: The 3D plot of exp( (x 2 +y 2 )) with denser isolines 22

23 We can also make the surface show in colour and as a solid instead of meshed as above. For that we use the command set pm3d. Here is the source code that generates a colour coded surface (and the resulting figure is shown in Figure. 15). set pm3d set xrange[-2:2] set yrange[-2:2] set isosamples 41,41 f(x,y) = exp(-x*x-y*y) splot f(x,y) Figure 15: The 3D plot of exp( (x 2 +y 2 )) with colour coded surface Finally, it is possible to plot contours below the surface. It is done using the command set contour. The source code for a plot with contour is given below. The figure generated by the commands is shown in Figure

24 set pm3d set contour set xrange[-2:2] set yrange[-2:2] set isosamples 41,41 f(x,y) = exp(-x*x-y*y) splot f(x,y) Figure 16: The 3D plot of exp( (x 2 +y 2 )) with contours 2 References and further reading gnuplot manual See for FAQ, documentation and other relevant links. 24

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, 212 Copyright c 212, Prita Pant and M P Gururajan. Permission is granted to copy, distribute and/or modify

More information

Creating Plots with Gnuplot. May 18, 2017

Creating Plots with Gnuplot. May 18, 2017 Creating Plots with Gnuplot May 18, 2017 What is Gnuplot Gnuplot is a freely available command-line based interactive plotting program. $ gnuplot G N U P L O T Version 4.6 patchlevel 0 last modified 2012-03

More information

Data Graphics with Gnuplot

Data Graphics with Gnuplot Data Graphics with Gnuplot Le Yan User Services HPC @ LSU 4/17/2013 1 Training Goals Produce simple interactive plots and graphs Create 2- and 3-d graphs from functions and data files Understand the automation

More information

1 Gnuplot. Installing and running. Plot

1 Gnuplot. Installing and running. Plot 1 Gnuplot gnuplot is a simple and popular scripting language and program for producing plots. You may use any software you want for producing the plots in your report. Here, we introduce gnuplot because

More information

A Quick Guide to Gnuplot. Andrea Mignone Physics Department, University of Torino AA

A Quick Guide to Gnuplot. Andrea Mignone Physics Department, University of Torino AA A Quick Guide to Gnuplot Andrea Mignone Physics Department, University of Torino AA 2017-2018 What is Gnuplot? Gnuplot is a free, command-driven, interactive, function and data plotting program, providing

More information

Visualisation Lab: gnuplot

Visualisation Lab: gnuplot Visualisation Lab: gnuplot Anton Gerdelan February 2, 2012 What is gnuplot? gnuplot is a tool for creating graphs and charts. gnuplot has a terminal. You can enter commands to tell gnuplot how to format

More information

Goals for This Lecture:

Goals for This Lecture: Goals for This Lecture: Learn how to use gnuplot to make simple plots of data from a file. Introduce some basic I/O concepts Using Gnuplot to Plot data from a file Gnuplot (pronounced Ga-new-plot ) is

More information

Bivariate Normal Density

Bivariate Normal Density gnuplot 3.5 User's Guide KCAng Division of Mathematics, NTU-NIE, Singapore. kcang@nie.edu.sg June 2 Introduction This document introduces the new user to gnuplot for Windows. It is a brief document to

More information

Basic statistical operations

Basic statistical operations COSC 6397 Big Data Analytics Fundamental Analytics Edgar Gabriel Spring 2014 Basic statistical operations Calculating minimum, maximum, mean, median, standard deviation Data typically multi-dimensional

More information

Creating Graphs in Gnuplot

Creating Graphs in Gnuplot UNIVERSITY OF SURREY Creating Graphs in Gnuplot Rosh Sellahewa CONTENTS 1 Basic Plots 2 1.1 Opening Gnuplot in the Terminal...................... 2 1.2 Plotting From a File...............................

More information

On Unix, Linux and OS X systems start Gnuplot by simply opening a terminal and typing:

On Unix, Linux and OS X systems start Gnuplot by simply opening a terminal and typing: http://peopledukeedu/~hpgavin/gnuplothtml Page 1 of 8 2/18/2013 GNUPLOT 42 - A Brief Manual and Tutorial Department of Civil and Environmental Engineering Edmund T Pratt School of Engineering Duke University

More information

Graphical Analysis with Gnuplot. Evangelos Pournaras, Izabela Moise

Graphical Analysis with Gnuplot. Evangelos Pournaras, Izabela Moise Graphical Analysis with Gnuplot Evangelos Pournaras, Izabela Moise Evangelos Pournaras, Izabela Moise 1 Outline 1. Introduction to gnuplot 2. Gnuplot in practice 3. Plot examples 4. Output and terminals

More information

Gnuplot Tutorial. Gnuplot is a portable command-line driven graphing utility for - Linux, - MS Windows - Mac - Many other platforms.

Gnuplot Tutorial. Gnuplot is a portable command-line driven graphing utility for - Linux, - MS Windows - Mac - Many other platforms. Gnuplot Tutorial http://www.gnuplot.info https://www.cs.hmc.edu/~vrable/gnuplot/using-gnuplot.html http://people.duke.edu/~hpgavin/gnuplot.html Gnuplot is a portable command-line driven graphing utility

More information

Complex Integration (2B) Young Won Lim 1/17/14

Complex Integration (2B) Young Won Lim 1/17/14 omplex Integration (B) /7/ opyright (c) Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version. or any later

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

An Introduction to Gnuplot for Chemists. By Nicholas Fitzkee Mississippi State University Updated September 1, 2016

An Introduction to Gnuplot for Chemists. By Nicholas Fitzkee Mississippi State University Updated September 1, 2016 An Introduction to Gnuplot for Chemists By Nicholas Fitzkee Mississippi State University Updated September 1, 2016 Introduction Many biophysical problems involve fitting a model (as described by some mathematical

More information

Mathematical Computing

Mathematical Computing IMT2b2β Department of Mathematics University of Ruhuna A.W.L. Pubudu Thilan Graphics in Maxima Introduction Gnuplot is a comand-line oriented plot program. Maxima s plotting is based on the Gnuplot, which

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

Gnuplot. in Action. Understanding Data with Graphs MANNING. (74 w. long.) PHILIPP K. JANERT. Greenwich

Gnuplot. in Action. Understanding Data with Graphs MANNING. (74 w. long.) PHILIPP K. JANERT. Greenwich Gnuplot in Action Understanding Data with Graphs PHILIPP K. JANERT 11 MANNING Greenwich (74 w. long.) contents foreword xvii foreword xix prreface xxi acknowledgments xxiii about this book xxv pajrlt X

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

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

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

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

Data and Function Plotting with MATLAB (Linux-10)

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

INTRODUCTION TO MATLAB PLOTTING WITH MATLAB

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

STAT/MATH 395 A - PROBABILITY II UW Winter Quarter Matlab Tutorial

STAT/MATH 395 A - PROBABILITY II UW Winter Quarter Matlab Tutorial STAT/MATH 395 A - PROBABILITY II UW Winter Quarter 2016 Néhémy Lim Matlab Tutorial 1 Introduction Matlab (standing for matrix laboratory) is a high-level programming language and interactive environment

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

Basic Graphs. Dmitry Adamskiy 16 November 2011

Basic 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 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

2D LINE PLOTS... 1 The plot() Command... 1 Labeling and Annotating Figures... 5 The subplot() Command... 7 The polarplot() Command...

2D 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 information

Mechanical Engineering Department Second Year (2015)

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

A Very Brief Introduction to Matlab

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

MATLAB SUMMARY FOR MATH2070/2970

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

CHEM5302 Fall 2015: Rate Coefficients and Potential of Mean Force for a 2D Potential Model of Protein Folding

CHEM5302 Fall 2015: Rate Coefficients and Potential of Mean Force for a 2D Potential Model of Protein Folding CHEM532 Fall 215: Rate Coefficients and Potential of Mean Force for a 2D Potential Model of Protein Folding Ronald Levy November 17, 216 1 Introduction We are going to obtain rate coefficients in two ways.

More information

12 whereas if I terminate the expression with a semicolon, the printed output is suppressed.

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

Math Scientific Computing - Matlab Intro and Exercises: Spring 2003

Math Scientific Computing - Matlab Intro and Exercises: Spring 2003 Math 64 - Scientific Computing - Matlab Intro and Exercises: Spring 2003 Professor: L.G. de Pillis Time: TTh :5pm 2:30pm Location: Olin B43 February 3, 2003 Matlab Introduction On the Linux workstations,

More information

gnuplot or, How To Make Your Data Look Neat and Shiny Ron Ho 3/14/01

gnuplot or, How To Make Your Data Look Neat and Shiny Ron Ho 3/14/01 gnuplot or, How To Make Your Data Look Neat and Shiny Ron Ho 3/14/01 ronho@vlsi.stanford.edu 1 Introduction Plotting data into pretty charts is pretty standard fare Ultimate consumer: journals, conference

More information

PART 1 PROGRAMMING WITH MATHLAB

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

Classes 7-8 (4 hours). Graphics in Matlab.

Classes 7-8 (4 hours). Graphics in Matlab. Classes 7-8 (4 hours). Graphics in Matlab. Graphics objects are displayed in a special window that opens with the command figure. At the same time, multiple windows can be opened, each one assigned a number.

More information

Introduction to MATLAB: Graphics

Introduction to MATLAB: Graphics Introduction to MATLAB: Graphics Eduardo Rossi University of Pavia erossi@eco.unipv.it September 2014 Rossi Introduction to MATLAB Financial Econometrics - 2014 1 / 14 2-D Plot The command plot provides

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

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

MATLAB Guide to Fibonacci Numbers

MATLAB Guide to Fibonacci Numbers MATLAB Guide to Fibonacci Numbers and the Golden Ratio A Simplified Approach Peter I. Kattan Petra Books www.petrabooks.com Peter I. Kattan, PhD Correspondence about this book may be sent to the author

More information

Introduction to Gnuplot. Bob Dowling University Computing Service

Introduction to Gnuplot. Bob Dowling University Computing Service 1 Introduction to Gnuplot Bob Dowling University Computing Service 1 2 Course aims Simple graphs 2D Plotting data Scripted process No manual work 2 The aims of the course are to provide you with sufficient

More information

Graphics in MATLAB. Responsible teacher: Anatoliy Malyarenko. November 10, Abstract. Basic Plotting Commands

Graphics in MATLAB. Responsible teacher: Anatoliy Malyarenko. November 10, Abstract. Basic Plotting Commands Graphics in MATLAB Responsible teacher: Anatoliy Malyarenko November 10, 2003 Contents of the lecture: Two-dimensional graphics. Formatting graphs. Three-dimensional graphics. Specialised plots. Abstract

More information

Overview. Lecture 13: Graphics and Visualisation. Graphics & Visualisation 2D plotting. Graphics and visualisation of data in Matlab

Overview. Lecture 13: Graphics and Visualisation. Graphics & Visualisation 2D plotting. Graphics and visualisation of data in Matlab Overview Lecture 13: Graphics and Visualisation Graphics & Visualisation 2D plotting 1. Plots for one or multiple sets of data, logarithmic scale plots 2. Axis control & Annotation 3. Other forms of 2D

More information

MATLAB Tutorial. 1. The MATLAB Windows. 2. The Command Windows. 3. Simple scalar or number operations

MATLAB Tutorial. 1. The MATLAB Windows. 2. The Command Windows. 3. Simple scalar or number operations MATLAB Tutorial The following tutorial has been compiled from several resources including the online Help menu of MATLAB. It contains a list of commands that will be directly helpful for understanding

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

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

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 October, 2012 Copyright c 2012, Prita Pant and M P Gururajan. Permission is granted to copy, distribute and/or

More information

Blue 21 Extend and Succeed Brain Growth Senior Phase. Trigonometry. Graphs and Equations

Blue 21 Extend and Succeed Brain Growth Senior Phase. Trigonometry. Graphs and Equations Blue 21 Extend and Succeed Brain Growth Senior Phase Trigonometry Graphs and Equations Trig Graphs O1 Trig ratios of angles of all sizes 1. Given the diagram above, find sin 130, cos 130 and tan 130 correct

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

Plotting x-y (2D) and x, y, z (3D) graphs

Plotting x-y (2D) and x, y, z (3D) graphs Tutorial : 5 Date : 9/08/2016 Plotting x-y (2D) and x, y, z (3D) graphs Aim To learn to produce simple 2-Dimensional x-y and 3-Dimensional (x, y, z) graphs using SCILAB. Exercises: 1. Generate a 2D plot

More information

Green Globs And Graphing Equations

Green Globs And Graphing Equations Green Globs And Graphing Equations Green Globs and Graphing Equations has four parts to it which serve as a tool, a review or testing device, and two games. The menu choices are: Equation Plotter which

More information

A Mini-Manual for GNUPLOT

A Mini-Manual for GNUPLOT A Mini-Manual for GNUPLOT John E Floyd University of Toronto January 5, 2002 GNUPLOT is a useful program for creating charts of data for publication, frequently producing better quality charts than can

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

MAT 275 Laboratory 1 Introduction to MATLAB

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

Logical Subscripting: This kind of subscripting can be done in one step by specifying the logical operation as the subscripting expression.

Logical Subscripting: This kind of subscripting can be done in one step by specifying the logical operation as the subscripting expression. What is the answer? >> Logical Subscripting: This kind of subscripting can be done in one step by specifying the logical operation as the subscripting expression. The finite(x)is true for all finite numerical

More information

Artificial Neural Networks

Artificial Neural Networks The Perceptron Rodrigo Fernandes de Mello Invited Professor at Télécom ParisTech Associate Professor at Universidade de São Paulo, ICMC, Brazil http://www.icmc.usp.br/~mello mello@icmc.usp.br Conceptually

More information

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain Introduction to Matlab By: Dr. Maher O. EL-Ghossain Outline: q What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators (Arithmetic, relational, logical ) Display Facilities Flow Control

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

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

A very brief Matlab introduction

A very brief Matlab introduction A very brief Matlab introduction Siniša Krajnović January 24, 2006 This is a very brief introduction to Matlab and its purpose is only to introduce students of the CFD course into Matlab. After reading

More information

CSE 123. Plots in MATLAB

CSE 123. Plots in MATLAB CSE 123 Plots in MATLAB Easiest way to plot Syntax: ezplot(fun) ezplot(fun,[min,max]) ezplot(fun2) ezplot(fun2,[xmin,xmax,ymin,ymax]) ezplot(fun) plots the expression fun(x) over the default domain -2pi

More information

Programming in Mathematics. Mili I. Shah

Programming in Mathematics. Mili I. Shah Programming in Mathematics Mili I. Shah Starting Matlab Go to http://www.loyola.edu/moresoftware/ and login with your Loyola name and password... Matlab has eight main windows: Command Window Figure Window

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

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

PC-MATLAB PRIMER. This is intended as a guided tour through PCMATLAB. Type as you go and watch what happens.

PC-MATLAB PRIMER. This is intended as a guided tour through PCMATLAB. Type as you go and watch what happens. PC-MATLAB PRIMER This is intended as a guided tour through PCMATLAB. Type as you go and watch what happens. >> 2*3 ans = 6 PCMATLAB uses several lines for the answer, but I ve edited this to save space.

More information

FLUKA: Flair Plots. 7 th FLUKA Course NEA Paris, Sept.29-Oct.3, 2008

FLUKA: Flair Plots. 7 th FLUKA Course NEA Paris, Sept.29-Oct.3, 2008 FLUKA: Flair Plots 7 th FLUKA Course NEA Paris, Sept.29-Oct.3, 2008 Plot List Plot Types Geometry For geometry plots USRBIN For plotting the output of USRBIN USR-1D To plot single differential quantities

More information

Introduction to MATLAB

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

MATLAB Functions and Graphics

MATLAB Functions and Graphics Functions and Graphics We continue our brief overview of by looking at some other areas: Functions: built-in and user defined Using M-files to store and execute statements and functions A brief overview

More information

MATLAB Tutorial. Mohammad Motamed 1. August 28, generates a 3 3 matrix.

MATLAB Tutorial. Mohammad Motamed 1. August 28, generates a 3 3 matrix. MATLAB Tutorial 1 1 Department of Mathematics and Statistics, The University of New Mexico, Albuquerque, NM 87131 August 28, 2016 Contents: 1. Scalars, Vectors, Matrices... 1 2. Built-in variables, functions,

More information

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms:

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms: Appendix A Basic MATLAB Tutorial Extracted from: http://www1.gantep.edu.tr/ bingul/ep375 http://www.mathworks.com/products/matlab A.1 Introduction This is a basic tutorial for the MATLAB program which

More information

Computational Modelling 102 (Scientific Programming) Tutorials

Computational Modelling 102 (Scientific Programming) Tutorials COMO 102 : Scientific Programming, Tutorials 2003 1 Computational Modelling 102 (Scientific Programming) Tutorials Dr J. D. Enlow Last modified August 18, 2003. Contents Tutorial 1 : Introduction 3 Tutorial

More information

SciGraphica. Tutorial Manual - Tutorials 1and 2 Version 0.8.0

SciGraphica. Tutorial Manual - Tutorials 1and 2 Version 0.8.0 SciGraphica Tutorial Manual - Tutorials 1and 2 Version 0.8.0 Copyright (c) 2001 the SciGraphica documentation group Permission is granted to copy, distribute and/or modify this document under the terms

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

Lab of COMP 406 Introduction of Matlab (II) Graphics and Visualization

Lab of COMP 406 Introduction of Matlab (II) Graphics and Visualization Lab of COMP 406 Introduction of Matlab (II) Graphics and Visualization Teaching Assistant: Pei-Yuan Zhou Contact: cspyzhou@comp.polyu.edu.hk Lab 2: 19 Sep., 2014 1 Review Find the Matlab under the folder

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

Title. Author 1 Author 2 Author 3. January 23, 2015

Title. Author 1 Author 2 Author 3. January 23, 2015 Title Author 1 Author 2 Author 3 January 23, 2015 Abstract Place your abstract here. This document is a template for turning in project and assignment reports for Math 442. In addition, we go over some

More information

Prof. Manoochehr Shirzaei. RaTlab.asu.edu

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

PyPlot. The plotting library must be imported, and we will assume in these examples an import statement similar to those for numpy and math as

PyPlot. The plotting library must be imported, and we will assume in these examples an import statement similar to those for numpy and math as Geog 271 Geographic Data Analysis Fall 2015 PyPlot Graphicscanbeproducedin Pythonviaavarietyofpackages. We willuseapythonplotting package that is part of MatPlotLib, for which documentation can be found

More information

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

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

PtPlot: 2D Graphs within Java

PtPlot: 2D Graphs within Java Computational P hysics Rubin H. Landau, Manuel J. Páez and Cr istian C. Bordeianu 2007 W I LEY- VCH Ver la g Gmb H & Co 461 A PtPlot: 2D Graphs within Java PtPlot is an excellent plotting package that

More information

MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY

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

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

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

Introduction to MATLAB

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

Introduction to Python Practical 1

Introduction to Python Practical 1 Introduction to Python Practical 1 Daniel Carrera & Brian Thorsbro October 2017 1 Introduction I believe that the best way to learn programming is hands on, and I tried to design this practical that way.

More information

Miscellaneous Utilities

Miscellaneous Utilities Miscellaneous Utilities MJ Rutter mjr19@cam Easter 2013 Gnuplot Gnuplot is a simple graph plotting program. Here it is shown plotting sin(x). It has a simple command line interface, and uses a separate

More information

Translation of graphs (2) The exponential function and trigonometric function

Translation of graphs (2) The exponential function and trigonometric function Lesson 35 Translation of graphs (2) The exponential function and trigonometric function Learning Outcomes and Assessment Standards Learning Outcome 2: Functions and Algebra Assessment Standard Generate

More information

Computer Programming in MATLAB

Computer Programming in MATLAB Computer Programming in MATLAB Prof. Dr. İrfan KAYMAZ Engineering Faculty Department of Mechanical Engineering Arrays in MATLAB; Vectors and Matrices Graphing Vector Generation Before graphing plots in

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

EGR 102 Introduction to Engineering Modeling. Lab 05B Plotting

EGR 102 Introduction to Engineering Modeling. Lab 05B Plotting EGR 102 Introduction to Engineering Modeling Lab 05B Plotting 1 Overview Plotting in MATLAB 2D plotting ( ezplot(), fplot(), plot()) Formatting of 2D plots 3D plotting (surf(), mesh(), plot3()) Formatting

More information

DSP Laboratory (EELE 4110) Lab#1 Introduction to Matlab

DSP Laboratory (EELE 4110) Lab#1 Introduction to Matlab Islamic University of Gaza Faculty of Engineering Electrical Engineering Department 2012 DSP Laboratory (EELE 4110) Lab#1 Introduction to Matlab Goals for this Lab Assignment: In this lab we would have

More information

ISETL Graphics Guide. Using the Graphics Facility

ISETL Graphics Guide. Using the Graphics Facility ISETL Graphics Guide This document describes the graphics package for ISETL. If you are not familiar with ISETL, refer to the ISETL Getting Started Guide. Using the Graphics Facility The graphics facility

More information

fplot Syntax Description Examples Plot Symbolic Expression Plot symbolic expression or function fplot(f) fplot(f,[xmin xmax])

fplot Syntax Description Examples Plot Symbolic Expression Plot symbolic expression or function fplot(f) fplot(f,[xmin xmax]) fplot Plot symbolic expression or function Syntax fplot(f) fplot(f,[xmin xmax]) fplot(xt,yt) fplot(xt,yt,[tmin tmax]) fplot(,linespec) fplot(,name,value) fplot(ax, ) fp = fplot( ) Description fplot(f)

More information

PyPlot. The plotting library must be imported, and we will assume in these examples an import statement similar to those for numpy and math as

PyPlot. The plotting library must be imported, and we will assume in these examples an import statement similar to those for numpy and math as Geog 271 Geographic Data Analysis Fall 2017 PyPlot Graphicscanbeproducedin Pythonviaavarietyofpackages. We willuseapythonplotting package that is part of MatPlotLib, for which documentation can be found

More information

Dr. Iyad Jafar. Adapted from the publisher slides

Dr. Iyad Jafar. Adapted from the publisher slides Computer Applications Lab Lab 6 Plotting Chapter 5 Sections 1,2,3,8 Dr. Iyad Jafar Adapted from the publisher slides Outline xy Plotting Functions Subplots Special Plot Types Three-Dimensional Plotting

More information

Downloaded from

Downloaded from Top Concepts Class XI: Maths Ch : Trigonometric Function Chapter Notes. An angle is a measure of rotation of a given ray about its initial point. The original ray is called the initial side and the final

More information

Working with Charts Stratum.Viewer 6

Working with Charts Stratum.Viewer 6 Working with Charts Stratum.Viewer 6 Getting Started Tasks Additional Information Access to Charts Introduction to Charts Overview of Chart Types Quick Start - Adding a Chart to a View Create a Chart with

More information