Text Processing.

Slides:



Advertisements
Similar presentations
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Advertisements

MATLAB – What is it? Computing environment / programming language Tool for manipulating matrices Many applications, you just need to get some numbers in.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 19P. 1Winter Quarter MATLAB: Script and.
Additional Data Types: 2-D Arrays, Logical Arrays, Strings Selim Aksoy Bilkent University Department of Computer Engineering
ES 100: Lecture 7 String Functions 1.Log in 2.Open MATLAB 3.Change the current directory and path to U: 4.Change the numeric display to compact (File,
Introduction to MATLAB MECH 300H Spring Starting of MATLAB.
MATLAB Strings Selim Aksoy Bilkent University Department of Computer Engineering
AN ENGINEER’S GUIDE TO MATLAB
Text Processing. Outline Announcements: –Homework I: due Today. by 5, by Discuss on Friday. –Homework II: on web HW I: question 7 Finish functions.
GUI Input and Output Greg Reese, Ph.D Research Computing Support Group Academic Technology Services Miami University.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (3): MATLAB Environment (Chapter 1)
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
ENGR 1320 Final Review - Programming Major Topics: – Functions and Scripts – Vector and Matrix Operations in Matlab Dot product Cross product – Plotting.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room , Chris Hill, Room ,
ENG College of Engineering Engineering Education Innovation Center 1 Array Accessing and Strings in MATLAB Topics Covered: 1.Array addressing. 2.
CSE123 Lecture 3 Files and File ManagementScripts.
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.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
1-d Arrays & Plotting.
Matlab Programming a logical approach. Outline Announcements: –Homework I: due Wed. by 5, by –Last day to add/drop or change credit/audit Iteration.
Input Output Garbage In, Garbage Out. Outline Announcements: –Homework III: due Today. by 5, by Discuss on Friday. –Homework IV: on web, due following.
1. Comparing Strings 2. Converting strings/numbers 3. Additional String Functions Strings Built-In Functions 1.
CS 170 – INTRO TO SCIENTIFIC AND ENGINEERING PROGRAMMING.
Improving performance Matlab’s a pig. Outline Announcements: –Homework I: Solutions on web –Homework II: on web--due Wed. Homework I Performance Issues.
Strings Characters and Sentences 1.Overview 2.Creating Strings 3.Slicing Strings 4.Searching for substrings 1.
Arrays What is an array… –A data structure that holds a set of homogenous elements (of the same type) –Associate a set of numbers with a single variable.
Input Output Garbage In, Garbage Out. Outline Announcements: –HWII solutions on web soon –Homework III: due Wednesday Advanced ASCII Binary Basics Cell-arrays.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Scala File I/O. Types of files There are two kinds of files: Text files, and binary files Of course, it’s not that simple… Text files Text files are “human.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
File I/O. I/O Flags Flags are passed to give some information about how the file is to be used. – Read only file – flag=0x0 – Write only file – flag=0x1.
Physics 114: Lecture 1 Overview of Class Intro to MATLAB
Getting started with Matlab: Outline
EET 2259 Unit 13 Strings and File I/O
Computer Application in Engineering Design
Introduction to Matlab
MATLAB: Script and Function Files
MatLab Programming By Kishan Kathiriya.
MATLAB Basics Nafees Ahmed Asstt. Professor, EE Deptt DIT, DehraDun.
EGR 115 Introduction to Computing for Engineers
Variables, Expressions, and IO
Other Kinds of Arrays Chapter 11
Module 2 Arrays and strings – example programs.
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
MATLAB DENC 2533 ECADD LAB 9.
(Mohammed Sami) Ashhab
Advanced Programming Behnam Hatami Fall 2017.
MATLAB: Script and Function Files
StatLab Matlab Workshop
MATLAB How to use (using M-files) Double click this icon
Matlab review Matlab is a numerical analysis system
Command-line arguments
Use of Mathematics using Technology (Maltlab)
Learning Objectives String Class.
MATLAB How to use (using M-files) Double click this icon
String Manipulation Chapter 7 Attaway MATLAB 4E.
MATLAB How to use (using M-files)
Communication and Coding Theory Lab(CS491)
Command-line arguments
Homework Applied for cs240? (If not, keep at it!) 8/10 Done with HW1?
MATLAB: Script and Function Files
Text functions.
Matlab Basic Dr. Imtiaz Hussain
EET 2259 Unit 13 Strings and File I/O
Text Manipulation Chapter 7 Attaway MATLAB 5E.
Today’s Objectives 28-Jun-2006 Announcements
More Basics of Python Common types of data we will work with
MATLAB (Lecture 2) BY:MAHA ALMOUSA.
4.4 – List vs Array Exercise 4.1: Array Variables
Electrical and Computer Engineering Department SUNY – New Paltz
Presentation transcript:

Text Processing

Outline Announcements: Text Matlab path Survey Homework I: due Today. by 5, by e-mail Discuss on Friday. Homework II: on web Text Matlab path Survey

This isn’t English! Why do we need text? Comments from functions File names Label plots Interact with users Record-based I/O

Hello World! Create strings with single quote (’) a=‘Hello World!’ Believe it or not, characters are not doubles a is an array of char Can display text nicely with disp(str) if str is a matrix, each row is a new line

Working with text Concatenation--same as with other vectors a=‘Hello’; b=‘World!’; greetings=[a, ‘ ’,b]; Will greetings=[a;b] work?

Number-to-String Conversions int2str & num2str convert numbers to text str2num converts to numbers

Searching for strings can search for single characters with find search for substring ss in str with I=findstr(ss,str) findstr(str,ss) would also work if length(ss)<length(str)

Working with ASCII double(str) returns an array with ASCII codes str=‘012ABCabc’ num=double(str)=[48 49 50 65 66 67 97 98 99] char(num) converts ASCII codes to char char(num) returns ‘012ABCabc’

Misc. Text Functions R=input(QuestionStr) asks user for input, returned as R xlabel, ylabel, title --label plots text(x,y,str)--places string at x,y on plot S=sprintf(str, val1, val2, …)--C-like string creation S=sprintf(‘Integer %d\nDouble %f\n’, 5, -pi); Integer 5 Double -3.141593 S is 1-by-27

Matlab Path Matlab maintains a list of directories where it searches for files Type “path” to see Can add directories using addpath or through GUI To make permanent, place addpaths in startup.m a special script that is executed at startup

Personal Opinion* Create your own m-files directory, & put m-files there group m-files into subdirectories by topics Place addpaths in startup.m so you can always use your functions CD into data directories & work there On multi-user PC system, may need to call your startup file each time you start (to keep your stuff separate from everyone else) *Above is the instructor’s opinion and does not necessarily reflect that of CIS or Cornell University

Survey You now know the basics of Matlab The rest of the course will be spent extending and reinforcing that knowledge More Matlab or more applications? Matlab Polymorphic functions Objects beyond arrays Improving performance Applications File I/O (binary & text) Linear Systems Diff. Equations Statistics Graphics Polynomials & splines