1 16 November Matlab Copied from the original document on file at the Smokey Valley Genealogical Society and Library in Salina, KS, and reprinted by The.

Slides:



Advertisements
Similar presentations
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Advertisements

 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
The Web Warrior Guide to Web Design Technologies
 2005 Pearson Education, Inc. All rights reserved Introduction.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
PHP Introduction.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
1 Chapter 4 Language Fundamentals. 2 Identifiers Program parts such as packages, classes, and class members have names, which are formally known as identifiers.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
College Algebra Exam 2 Material.
Recitation 1 Programming for Engineers in Python.
1 CS1130 Spring 2011: David Gries & Walker White Transition to Object-Oriented Programming Assumes programming knowledge in a language like Matlab, C,
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
Tennessee Diploma Project: Tennessee’s Future 9-12 English Standard Awareness.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
1 CS100J 16 March 2006 Arrays Reading: You are responsible for: Secs 8.1, 8.2, 8.3, 8.4 A decimal point I'm a dot in placeSlot machines Cash lost in 'em.
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.
Tennessee Diploma Project: Tennessee’s Future 9-12 English Standard Awareness.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Productivity Programs Common Features and Commands.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 5 INTRODUCTION JAVASCRIPT G H E F.
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Advanced Topics- Functions Introduction to MATLAB 7 Engineering 161.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Winter Semester 2014/2015 College of Engineering.
Language Conventions Quick Quiz???. 8th Grade Grammar From 1895?
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
STAYING SAFE: Here are some safety tips when using Change your password regularly and keep it in a safe place. Don’t share your password with anyone.
ASP-5-1 ASP Control Structures Colorado Technical University IT420 Tim Peterson.
Getting Started with MATLAB (part2) 1. Basic Data manipulation 2. Basic Data Understanding 1. The Binary System 2. The ASCII Table 3. Creating Good Variables.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Structured Programming II: If Statements By the end of this class you should be able to: implement branching in a program describe and use an “if” statement.
No Excuses The 5 Effective Practices for High Performing, High Poverty Schools.
Tutorial 11 1 JavaScript Operators and Expressions.
1 CS100J 13 October 2005 Arrays. Reading: Secs 8.1, 8.2, 8.3. Please listen to the following lectures on loops on your Plive CD. They are only 2-3 minutes.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
1 CS100J April Course evaluation. Please complete the online course evaluation form for CS100J. It does indeed help us improve the course. Completion.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Fundamentals of Programming Most.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Introduction to Programming G50PRO University of Nottingham Unit 6 : Control Flow Statements 2 Paul Tennent
Getting Started With Python Brendan Routledge
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Harvard Mark I Howard Aiken was a pioneer in computing and a creator of conceptual design for IBM in the 1940s. He envisioned an electro-mechanical computing.
Post-Grad, World Trade Center Universities: 16 years
Chapter 10 Programming Fundamentals with JavaScript
Use a dictionary to answer questions about spelling, syllabication, pronunciation, parts of speech, and definitions. Objectives Use an office reference.
Prof. Mark Glauser Created by: David Marr
Matlab Training Session 4: Control, Flow and Functions
GC211Data Structure Lecture2 Sara Alhajjam.
Using Standardized Achievement Data for School Improvement Planning
Scripts & Functions Scripts and functions are contained in .m-files
Chapter 10 Programming Fundamentals with JavaScript
CS100J 26 April. Matlab Use help button!!! Variables, values, types
Use of Mathematics using Technology (Maltlab)
Coding Concepts (Basics)
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Tutorial 10: Programming with javascript
Presentation transcript:

1 16 November Matlab Copied from the original document on file at the Smokey Valley Genealogical Society and Library in Salina, KS, and reprinted by The Salina Journal. 8th Grade Final Exam: Salina, KS, from 1895 This is an 8-hour test (continued on next page) We spend the rest of the semester looking at the programming language Matlab. This language has variables, if-statements, loops, methods (called functions and procedures), like Java. But it has no OO concepts. Instead, its operations on arrays and its ability to create graphs and tables make it well suited for a lot of engineering type problem solving. We do not spend time looking at loops and if-statements --you can learn these things yourself. We concentrate instead on the new kinds of things that Matlab brings to the programming table.

2 Arithmetic (Time, 1.25 hours) 1. Name the Fundamental Rules of Arithmetic. 2. A wagon box is 2 ft. deep, 10 feet long, and 3 ft. wide How many bushels of wheat will it hold? 3. If a load of wheat weighs 3942 lbs., what is it worth at 50cts/bushel, deducting 1050 lbs. for tare? 4. District No. 33 has a valuation of $35,000. What is the necessary levy to carry on a school seven months at $50 per month, and have $104 for incidentals? 5. Find the cost of 6720 lbs. coal at $6.00 per ton. 6. Find the interest of $ for 8 months and 18 days at 7 percent. 7. What is the cost of 40 boards 12 inches wide and 16 ft. long at $20 per metre? 8. Find bank discount on $300 for 90 days (no grace) at 10 percent. 9. What is the cost of a square farm at $15 per acre, the distance of which is 640 rods? 10. Write a Bank Check, a Promissory Note, and a Receipt. 8th grade test from 1895 Grammar (Time, one hour) 1. Give nine rules for the use of capital letters. 2. Name the parts of speech and define those that have no modifications. 3. Define verse, stanza, and paragraph. 4. What are the principal parts of a verb? Give principal parts of "lie”, "play”, and "run”. 5. Define case; Illustrate each case. 6. What is punctuation? Give rules for principal marks of punctuation Write a composition of about 150 words and show therein that you understand the practical use of the rules of grammar.

3 U.S. History (Time, 45 minutes) 1. Give the epochs into which U.S. History is divided. 2. Give an account of the discovery of America by Columbus. 3. Relate the causes and results of the Revolutionary War. 4. Show the territorial growth of the United States. 5. Tell what you can of the history of Kansas. 6. Describe three of the most prominent battles of the Rebellion. 7. Who were the following: Morse, Whitney, Fulton, Bell, Lincoln, Penn, and Howe? 8. Name events connected with the following dates: 1607, 1620, 1800, 1849, th grade test from 1895 Orthography (Time, one hour) 1. What is meant by the following: Alphabet, phonetic, orthography, etymology, syllabication? 2. What are elementary sounds? How classified? 3. What are the following, and give examples of each: Trigraph, subvocals, diphthong, cognate letters, linguals 4. Give four substitutes for caret 'u.’ (HUH?) 5. Give two rules for spelling words with final 'e.' Name two exceptions under each rule. 6. Give two uses of silent letters in spelling. Illustrate each. 7. Define the following prefixes and use in connection with a word: bi, dis, mis, pre, semi, post, non, inter, mono, sup.

4 8th grade test from 1895 Orthography (continued) 8. Mark diacritically and divide into syllables the following, and name the sign that indicates the sound: card, ball, mercy, sir, odd, cell, rise, blood, fare, last. 9. Use the following correctly in sentences: cite, site, sight, fane, fain, feign, vane, vain, vein, raze, raise, rays. 10. Write 10 words frequently mispronounced and indicate pronunciation by use of diacritical marks and by syllabication. Geography (Time, one hour) 1. What is climate? Upon what does climate depend? 2. How do you account for the extremes of climate in Kansas? 3. Of what use are rivers? Of what use is the ocean? 4. Describe the mountains of North America. 5. Name and describe the following: Monrovia, Odessa, Denver, Manitoba, Hecla, Yukon, St. Helena, Juan Fernandez, Aspinwall and Orinoco. 6. Name and locate the principal trade centers of the U.S. 7. Name all the republics of Europe and give the capital of each. 8. Why is the Atlantic Coast colder than the Pacific in the same latitude? 9. Describe the process by which the water of the ocean returns to the sources of rivers. 10. Describe the movements of the earth. Give the inclination of the earth.

5 CS100J 16 November Matlab Type commands here Double click on an entry to move it to command window. Use arrow keys Variables, values, types Use help button!!!

6 Scripts Obtained by clicking help and searching for “script”

7 Variables and types In Java, every variable must be declared with a type, and the values that can be placed in a variable are restricted to variables of that type. Java is a strongly typed language. In Matlab, no variable has to be declared, and you can put anything in a variable. One millisecond it may be an integer, the next, a two- dimensional array. Matlab is a weakly typed language. Each kind of language has its advantages and disadvantages. Weakly typed languages, some say, provide more flexibility and ease of programming. Strongly typed languages offer protection against certain kinds of errors, like storing a boolean value by mistake in an integer variable. For large programs involving many programmers, strongly typed languages are invaluable.

8 Scripts Script file: an external file that contains a sequence of MATLAB statements. Has extension.m ; called M-file. Type the filename to execute statements. Useful for automating blocks of MATLAB commands, such as computations you have to perform repeatedly from the command line. Scripts can operate on data in the workspace or can create new data on which to operate. Any variables they create remain in the workspace No declarations or begin/end delimiters required. Comments: Any text following a percent sign (%) on a given line is comment text. Comments can appear on lines by themselves or can appear after a statement on an executable line.

9 Example of a script Created using File->New-> M-File. Stored automatically in folder work within MatLab. You can navigate to store it where you want. I If you work in a Cornell lab, save your m-files on your own USB storage key or them to yourself.

10 Conditional statements if expression statements end if expression1 statements1 elseif expression2 statements2 else statements3 end Logical operators. 0 represents false Not-0 represents true A & B A | B ~A Short circuit evaluation: A && B A || B Found these by typing “if” into search window of Help Found these by typing “logical operators” into search window of Help

11 Loops for index= start: increment: end statements end If you leave out the increment, 1 is used. while expression statements end Found this info by typing “loop” into search window of Help %Example: binary search t= size(r); nocols= t(2); x= -5; % Row Vector r is sorted. % Store in h an integer that satisfies % r[1..h] <= x < f[h+1..nocols] h= 0; k= nocols+1; %invariant: r[1..h] <= x < f[k..nocols] while (h+1 < k) e= floor((h+k)/2); if (r(e) <= x ) h= e; else k= e; end