CMPS 1371 Introduction to Computing for Engineers FILE Input / Output.

Slides:



Advertisements
Similar presentations
BroilerOpt A Broiler Optimization Program Getting Started III Matrix and Diet Transfer From Brill System.
Advertisements

Office Links - Sharing Data in Microsoft Office A Mixed Bag of Treasures Chester N. Barkan Registrar Long Island University, C.W.Post Campus.
The INFILE Statement Reading files into SAS from an outside source: A Very Useful Tool!
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
Excel Objects, User Interface, and Data Entry. ◦ Application Window  Title Bar  Menu Bar  Toolbars  Status Bar  Worksheet Window  Worksheet Input.
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a Spreadsheet?
Lecture 7 Debugging Code & Data Import/Export © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
Excel 2007 ® Business and Personal Finances How can Excel 2007 help you format a workbook?
Exploring Microsoft Excel 2002 Chapter 7 Chapter 7 List and Data Management: Converting Data to Information By Robert T. Grauer Maryann Barber Exploring.
Chapter 7 Data Management. Agenda Database concept Import data Input and edit data Sort data Function Filter data Create range name Calculate subtotal.
Microsoft Access Exporting Access Data and Mail Merging.
1 Committed to Shaping the Next Generation of IT Experts. Chapter 3 – Graphs and Charts: Delivering a Message Robert Grauer and Maryann Barber Exploring.
Introduction to Spreadsheets Presented by Frank H. Osborne, Ph. D. © 2005 Bio 2900 Computer Applications in Biology.
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.
CS221 File Output Using Special Formats. What is a File? A file is a collection of information The type of information in the file can differ image, sound,
Integrating Microsoft Project with Other Programs
Excel 2007 ® Business and Personal Finances How can Excel 2007 help you format a workbook?
Exploring Excel 2003 Revised - Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a.
MATLAB File Management. MATLAB User File Management Matlab provides a group of commands to manage user files. For more information, type help iofun. pwd.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
Introduction to Spreadsheet Software. Spreadsheets and Their Uses Examples of Charts Spreadsheet Basics Spreadsheet Map Types of Spreadsheet Data Navigating.
Miscellaneous Excel Combining Excel and Access. – Importing, exporting and linking Parsing and manipulating data. 1.
Cell Arrays 1.Definition 2.Creating Cell Arrays 3.Referencing Cell Arrays 4.Augmenting Cell Arrays 5.Use of Cell Arrays 1.
MEGN 536 – Computational Biomechanics MATLAB: Getting Started Prof. Anthony J. Petrella Computational Biomechanics Group.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
File I/O 1. Goals of this chapter 2. General Concept, lots of examples 3. High-level I/O 1. Built-in functions that do everything in one step 4. Low-level.
A Brief Introduction to Matlab Laila Guessous Dept. of Mechanical Engineering Oakland University.
Introduction to File I/O High-Level Functions 1.Data files 2."High level" File I/O 3.dlmread() 4.xlsread() 1.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 1 Introduction.
Introduction to Excel 2010 Written by: Andie Philo.
Basic File Input and Output Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Lecture 13 File Input/Output From Chapter 8. Outline 8.1 Concept: Serial Input and Output (I/O) 8.2 MATLAB Workspace I/O 8.3 High-level I/O Functions.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
1 Microsoft Excel An Introduction to Spreadsheets Lecture 18.
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2 – Gaining Proficiency: The Web and Business.
File I/O High-Level Functions 1. Definition 2. Is a High-Level function appropriate? 3. xlsread() 4. dlmread() 1.
ISU Basic SAS commands Laboratory No. 1 Computer Techniques for Biological Research Animal Science 500 Ken Stalder, Professor Department of Animal Science.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
How do I export the Address Book to Excel? The first step is to go to "Address Book Report" under Admin Only menu Choose the fields you want. note that.
Microsoft Excel 2003 Illustrated Complete Data with Other Programs Exchanging.
COMP 116: Introduction to Scientific Programming Lecture 29: File I/O.
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.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Project 2 Completing a Three Dimensional Workspace Using Logical and Lookup Functions Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
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()
Workshop 3: Data Import. Importing data Normally, data to be imported into Excel work sheet are available as: - Excel work sheet file (.XLS) - Public.
1 CSC103: Introduction to Computer and Programming Lecture No 27.
Project Planning Defining the project Software specification Development stages Software testing.
Sundermeyer MAR 999 Spring Laboratory in Oceanography: Data and Methods MAR599, Spring 2009 Miles A. Sundermeyer Data Handling in Matlab.
An Introduction to Programming in Matlab Emily Blumenthal
Pasewark & Pasewark 1 Excel Lesson 1 Excel Basics Microsoft Office 2007: Introductory.
Excel 2007 ® Business and Personal Finances How can Excel 2007 help you format a workbook?
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a Spreadsheet?
Working with files Saving and loading Matlab variables to and from .mat files does not require any special file handling, just use save() and load() However,
By Shivgan Joshi Qcfinance.in
IMPORTING AND EXPORTING DATA
Access Lesson 14 Import and Export Data
Microsoft Office Illustrated
Functions (subprograms)
Jeff Henrikson Lecture 11 Data Import & Export Jeff Henrikson 1.
Advanced Data Import & Export Jeff Henrikson
Communication and Coding Theory Lab(CS491)
funCTIONs and Data Import/Export
ICT Spreadsheets Lesson 1: Introduction to Spreadsheets
Working With Data.
Retrieving numerical values.
Recapitulation of Lecture 5
ME 123 Computer Applications I Lecture 5: Input and Output 3/17/03
Presentation transcript:

CMPS 1371 Introduction to Computing for Engineers FILE Input / Output

File Input and Output Reading from a source Writing to a destination

Reading and Writing Data from Files Some common types of data files are mat dat txt xls jpg

Load and Save commands The highest (most abstract) level of file I/O operations works with the entire MATLAB workspace, or with individual variables. >>save demo1 or >>load demo1 >>help save or >>help load

Save and Load Let’s try this Review the HELP descriptions for save and load. Create several variables, Save them to disk, Clear memory, Load one of the variables

Data Import and Export The next lower level of file I/O describes working with entire files at once, but files whose contents are not explicitly MATLAB variables. For example, working with spreadsheets, images, audio, and video files, or raw ASCII text. MATLAB provides numerous functions to help in working with these different formats. >> help fileformats

Numeric Data Files It is common to encounter files that contain columns and rows of numeric data numbers have different precisions and formats delimiters (spaces, tabs, ;) separate columns Space delimiterComma delimiter e e e e e+000 1, 5.00, e+000 1, 5.20, e+000 1, 5.40, e+000 1, 5.60, e+000 1, 5.80, e+000

Numeric Data Files Command: dlmread( ) - read data from a text file Examples: >> data = dlmread(‘file.txt’,‘ ’); >> data1= dlmread(‘file.dat’,‘;’,range); >> help dlmread Specify a range of data within file to read Specify a delimiter YRMODAYID HRSRATE PAY $6.50$ $5.25$ $8.75$ $7.25$ $6.25$ $9.00$ $6.75$ $7.00$ $8.50$42.50

Text Data Files When the data file contains text, dlmread( ) cannot handle it properly One solution is to use importdata( ) which is described in the fileformats help info. importdata( ) will separate the text columns and the numeric columns into separate fields in a structure. The contents of the structure can be copied into numeric variables for analysis. >> a = importdata(‘file.txt’,‘ ’,headerline); >>

Spreadsheet Data xlsread( ) - read data from an Excel spreadsheet Let’s try: Create a spreadsheet with Excel, Explore various forms of xlsread( ) function, How are data stored in MATLAB? What about column and row names? What about the formulas? Check out the xlsfinfo( ) function >> m = xlsread(‘file.xls’); >> [a,b] = xlsread(‘file.xls’); >> help xlsread Numbers in a and text in b

Import Wizard Use the import wizard to determine the data type and to suggest ways to represent the data Launch from the file menu

Exporting Data Use the save function for.mat or.dat files Use specialized functions for other file types For example xlswrite for Excel files

Importing and Exporting Data MATLAB includes a number of specialized import functions optimized for a variety of file formats Companion functions allow data to be exported in the same file formats