Docsity

CS1371 Week 1 Teaching Outline: Introduction to Matlab and Vectors, Study notes of Computer Science

Toggle sidebar
bg1
CS1371 Teaching Outlines
Week 1
Philosophical Notes:
1. with a text book containing all the students should know, we are free to explain the difficult parts of a chapter, but
expect the students to dig around for the rest of it.
2. Having said that, many of the chapters push just a bit further than the students really need to go, thereby challenging
the top flight students. We might have to make clear which parts are “beyond the pale.”
Homework 1 topic: Getting Started
Homework 2 topic: Basic Vectors – so we must introduce vectors on Friday
Monday January 8th, 2007
Objective: Introduce Matlab – Chs 1 & 2
Introductions
Show of hands by major
Show of hands by class year
Introduce yourself
Course Overview
Slide presentation
Open class Web site
Point them to Syllabus page
Concept: variables and assignment
Difference between algebraic = and assignment.
Encourage useful variable names
Wednesday, January 10th, 2007
Objective: Scripts – Chapter 3
Problem Solving
Discuss Space Ship One (or some other problem type) –
oX prize
oCarried to 50,000 ft on mother ship
oRocket motor gives vertical velocity V
oOuter space defined as above 100 km altitude
oHow would you calculate the required velocity? (v2 = u2 + 2 a s)
o$15,000 for ride into outer space
oIf you had some velocity V1 (> V), how long would you get in outer space for your money? (s = u t + ½ a t2 )
-> quadratic equation
Matlab Introduction
Enter some stuff into the Matlab Command Window.
Show the variables appearing in the Workspace.
Do the velocity problem
o1 km = 3281 ft
og = -9.81 m/sec2
Writing a Script
Talk about the Current Directory (I usually work from my Acme account)
Open the empty script provided in the Matlab editor
Demonstrate do-a-bit / test-a-bit strategy using the Debug/Save and Run menu item (F5) with the velocity and time
above 100 km problems
Solve the quadratic equation in the script explicitly as shown in the finished solution
pf2

Partial preview of the text

Download CS1371 Week 1 Teaching Outline: Introduction to Matlab and Vectors and more Study notes Computer Science in PDF only on Docsity!

CS1371 Teaching Outlines

Week 1

Philosophical Notes:

  1. with a text book containing all the students should know, we are free to explain the difficult parts of a chapter, but expect the students to dig around for the rest of it.
  2. Having said that, many of the chapters push just a bit further than the students really need to go, thereby challenging the top flight students. We might have to make clear which parts are “beyond the pale.”

Homework 1 topic: Getting Started

Homework 2 topic: Basic Vectors – so we must introduce vectors on Friday

Monday January 8th, 2007

Objective: Introduce Matlab – Chs 1 & 2

Introductions

 Show of hands by major  Show of hands by class year  Introduce yourself

Course Overview

 Slide presentation  Open class Web site  Point them to Syllabus page

Concept: variables and assignment

 Difference between algebraic = and assignment.  Encourage useful variable names

Wednesday, January 10th, 2007

Objective: Scripts – Chapter 3

Problem Solving

 Discuss Space Ship One (or some other problem type) – o (^) X prize o (^) Carried to 50,000 ft on mother ship o (^) Rocket motor gives vertical velocity V o (^) Outer space defined as above 100 km altitude o (^) How would you calculate the required velocity? (v (^2) = u (^2) + 2 a s) o (^) $15,000 for ride into outer space o (^) If you had some velocity V 1 (> V), how long would you get in outer space for your money? (s = u t + ½ a t (^2) ) -> quadratic equation

Matlab Introduction

 Enter some stuff into the Matlab Command Window.  Show the variables appearing in the Workspace.  Do the velocity problem o (^) 1 km = 3281 ft o (^) g = -9.81 m/sec^2

Writing a Script

 Talk about the Current Directory (I usually work from my Acme account)  Open the empty script provided in the Matlab editor  Demonstrate do-a-bit / test-a-bit strategy using the Debug/Save and Run menu item (F5) with the velocity and time above 100 km problems  Solve the quadratic equation in the script explicitly as shown in the finished solution

Friday, January 12th, 2007

Objective: How to do and turn in homework

Introduction to WebCT

 Show the links on the class Web site to WebCT Vista  Have a student volunteer: o (^) go through the registration process o (^) submit your script as his/her HW o (^) retrieve and verify the HW

Homework Mechanics

Walk through the following steps for doing Homework 1.  Discuss file storage and a working directory: o (^) On your own computer, store files in the default Matlab working directory Matlabr7/work. o (^) On a campus computer, either use the Y drive that should be mapped to your gt account, or a floppy disk, or a memory stick.  Retrieving the homework file: o (^) Open the class web site o (^) Scroll down to Homework 1 o (^) Right click on Homework 1 o (^) Choose Save target As … o (^) Navigate to your working directory (see above) o (^) Make sure the file has the name hw1.m o (^) Accept that location and let the system download the file o (^) Decline the offer to open the file  Doing the homework o (^) Start Matlab o (^) Point the current directory to your working directory o (^) Double click the file – this should open the matlab editor o (^) Build and test solutions incrementally o (^) [since a student will submit this file, where the gt number is required, put a comment in caps like :THIS FILE ACTUALLY DONE BY PROF BOBICK]

Introduce Vectors

 Create vectors with […], linspace(…), zeros(…), ones(…), rand(…).  Access the data by indexing – out of bounds below, above the size  Shorten vectors with []  Write a script to plot sqrt(sin(x)) or something. You assume that functions can accept a vector and produce a vector.

Monday, January 15th, 2007

School Holiday