Basic File Input and Output Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See

Slides:



Advertisements
Similar presentations
Matlab Intro Simple introduction to some basic Matlab syntax. Declaration of a variable [ ] Matrices or vectors Some special (useful) syntax. Control statements.
Advertisements

How to install “bubble” fonts These fonts are used to create the Formative Assessment sheets.
Introduction to MATLAB The language of Technical Computing.
1 Trieste, April 17 th 2008Lucio Zambon Electronic Graphic Interface for Global Archiving Technology: PHP, MySQL, JavaScript, JPGraph, etc Development.
Introduction to Matlab
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
MATLAB – What is it? Computing environment / programming language Tool for manipulating matrices Many applications, you just need to get some numbers in.
Visualization Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
FORTRAN Short Course Week 1 Kate T-C February 17, 2008.
More Flow Control Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
DATA RETRIEVAL AND GUI CREATION DAVID COOPER SUMMER 2014.
Introduction to GTECH 201 Session 13. What is R? Statistics package A GNU project based on the S language Statistical environment Graphics package Programming.
Graphics in MATLAB Week 15 – 5/5/09 Kate Musgrave
Programming in MATLAB Week 14 – 4/28/09 Kate Musgrave
Fall 2006AE6382 Design Computing1 Matlab File & Directory Management Learning Objectives Define file input and output terminology Compare high and low.
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
Add a File with X, Y coordinates to MapWindow
ACCB 133 Information Technology and Accounting Applications Lecture 6: Application Software.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 21P. 1Winter Quarter MATLAB: Structures.
M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files called M- files. M-files are.
Matlab tutorial course Exercises 2:. Exercises Copy the script ‘face_points.m’ from my webpage into your ‘scripts’ folder Create a new folder in your.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
COMPUTER PARTS AND COMPONENTS INPUT DEVICES
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
Technology TEKS (3-5) Communication. Instructions On the following slides, you will click on the clip art picture to hyperlink to websites. After you.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Browsing Directories Copyright © Software Carpentry and The University of Edinburgh This work is licensed under the Creative Commons Attribution.
CMPS 1371 Introduction to Computing for Engineers FILE Input / Output.
Specialized Input and Output. Inputting Sound ● The microphone is the most basic device for inputting sounds into a computer ● Microphones capture sounds.
Term 2, 2011 Week 1. CONTENTS Problem-solving methodology Programming and scripting languages – Programming languages Programming languages – Scripting.
R packages/libraries Data input/output Rachel Carroll Department of Public Health Sciences, MUSC Computing for Research I, Spring 2014.
Language Basics and Data Types ● What and why of Matlab. ● Matlab desktop. ● Familiarize ourselves with basics of language. ● Basic types of data that.
File Input and Output July 2nd, Inputs and Outputs Inputs Keyboard Mouse storage(hard drive) Networks O utputs Graphs Images Videos(image stacks)
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Linear Algebra Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
1 Software Reliability Analysis Tools Joel Henry, Ph.D. University of Montana.
Using Text Files in Excel File I/O Methods. Working With Text Files A file can be accessed in any of three ways: –Sequential access: By far the most common.
Introduction Copyright © Software Carpentry This work is licensed under the Creative Commons Attribution License See
Comparison of different output options from Stata
Files: By the end of this class you should be able to: Prepare for EXAM 1. create an ASCII file describe the nature of an ASCII text Use and describe string.
MATLAB for Engineers, by Holly Moore. ISBN © 2007 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is.
Basics Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Finding Things Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Early File I/O To help you get started with your final project 1. Definition of “high level” 2. Is using a High Level function appropriate? 3. xlsread()
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
Functions Commands Programming Steps Examples Printing Homework Hints.
การใช้งานโปรแกรม MATLAB ดร. อำนาจ ขาวเน. BASIC ELEMENTS OF MATLAB MATLAB Desktop MATLAB Editor Help System MATLAB (MATrix LABoratory)
An Introduction to Programming in Matlab Emily Blumenthal
Physics 114: Lecture 1 Overview of Class Intro to MATLAB
More File Input and Output
Reading and Writing Image Files
Lecture: MATLAB Chapter 1 Introduction
Ch3 Graphics Overview of Plotting Editing Plots
DTIAtlasFiberAnalyzer Tutorial
Functions CIS 40 – Introduction to Programming in Python
Functions (subprograms)
Jeff Henrikson Lecture 11 Data Import & Export Jeff Henrikson 1.
Advanced Data Import & Export Jeff Henrikson
Matlab review Matlab is a numerical analysis system
Hello World! Syntax.
Digital Image Processing
Communication and Coding Theory Lab(CS491)
funCTIONs and Data Import/Export
CSE 307 Basics of Image Processing
ME 123 Computer Applications I Lecture 5: Input and Output 3/17/03
Presentation transcript:

Basic File Input and Output Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See for more information. MATLAB Programming

MATLABBasic I/O Scientists use (a lot of) data Images ( matrix ) Sound files ( array or matrix) Video ( 3 dimension matrix ) Instrument output ( time series ) Spreadsheets ( set of matrices ) … MATLAB can read all of these… and more.

MATLABBasic I/O Data import and output: Input and convert to data structure Print output to the screen Write arrays in a suitable file format.

MATLABBasic I/O Two ways to import data: Using the graphical interface

MATLABBasic I/O Two ways to import data: Using the graphical interface Easiest to learn MATLAB figures out what kind of file you have

MATLABBasic I/O Two ways to import data: Using the graphical interface Easiest to learn MATLAB figures out what kind of file you have Using the command line

MATLABBasic I/O Two ways to import data: Using the graphical interface Easiest to learn MATLAB figures out what kind of file you have Using the command line Can be automated Supports many more formats

MATLABBasic I/O

MATLABBasic I/O

MATLABBasic I/O.mat file: MATLAB’s prefered format. Binary, which saves space. Designed to store multiple variables.

MATLABBasic I/O Double click

MATLABBasic I/O Text data: comma or space separated My file: tweets.txt Latitude longitude tweet_density

MATLABBasic I/O Load data into MATLAB: >> data = importdata(‘tweets.txt’);

MATLABBasic I/O Load data into MATLAB: >> data = importdata(‘tweets.txt’); importdata is a ‘wrapper function.’ Identifies the format of the file Is it text, image, MAT file format, spreadsheet, sound, XML, … ? Find the correct function to load the file. Optional arguments can help figure this out.

MATLABBasic I/O importdata(file, options) load(…) xmlread(…) …imread(…)

MATLABBasic I/O >> in = importdata(‘tweets.txt’); >> in in = data: [40000x3 double] textdata: {'Lat' ' Lng' ' Weight'} colheaders: {'Lat' ' Lng' ' Weight'}

MATLABBasic I/O >> in = importdata(‘tweets.txt’); >> in in = data: [40000x3 double] textdata: {'Lat' ' Lng' ' Weight'} colheaders: {'Lat' ' Lng' ' Weight'}

MATLABBasic I/O >> in = importdata(‘tweets.txt’); >> in in = data: [40000x3 double] textdata: {'Lat' ' Lng' ' Weight'} colheaders: {'Lat' ' Lng' ' Weight'}

MATLABBasic I/O >> in = importdata(‘tweets.txt’); >> in in = data: [40000x3 double] textdata: {'Lat' ' Lng' ' Weight'} colheaders: {'Lat' ' Lng' ' Weight'}

MATLABBasic I/O MATLAB can also read things like spreadsheets: >> in = importdata(‘mydata.xls’); >> in in = Sheet1 = [6 x 2 double] Sheet2 = [13 x 1 double]

MATLABBasic I/O MATLAB can also read things like spreadsheets: >> in = importdata(‘mydata.xls’); >> in in = Sheet1 = [6 x 2 double] Sheet2 = [13 x 1 double] Each sheet is a member of the structure

MATLABBasic I/O Exporting results: Visualization Printing to screen Exporting to a file

MATLABBasic I/O Exporting results: Visualization Printing to screen Exporting to a file Special episode on graphing and images

February 2011 created by Richard T. Guy Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See for more information.