Download presentation

Presentation is loading. Please wait.

Published byBrianna Hampton Modified over 2 years ago

1
General Computer Science for Engineers CISC 106 Lecture 01 James Atlas Computer and Information Sciences 9/2/2009

2
Course Overview Website: ◦ http://www.udel.edu/CIS/jatlas/106/09F/ Lab based course ◦ MATLAB ◦ TA for each lab

3
Labs Pair programming Labs assigned on Monday Labs always due on the following Thursday at 11:55PM (10 days from assignment) Projects are group work and will be due 3 weeks after assigned

4
Grading Labs (25%) Participation (5%) Two Projects (10% + 10%) Two Midterm Exams (15% + 15%) Final Exam (20%) Your final course grade cannot be more than one letter grade higher than your exam average

5
Course Help Office Hours ◦ Tues 1-3PM Thurs 2-4PM ◦ TA: TBD Sakai ◦ Forums are great! E-mail

6
Intro to Computer Science Exercise:Compute based Pictionary Your team must create a list of instructions to draw a picture ◦ Choose a simple object to draw ◦ Numbers are allowed ◦ All prepositions, adjectives are allowed on, next to, across ◦ Nouns can only be geometric nouns: Circle Line Square ◦ No “car” or object nouns

7
MATLAB Command line Interactive (interpreted) matlab ◦ GUI version matlab -nodesktop ◦ Text version

8
MATLAB Prompt ◦ >> Expression ◦ >> 2 * 2 Variable ◦ >> product = 2 * 2

9
MATLAB How can we calculate the area of a circle? >> pi * 3^2 >> radius = 3 >> pi * radius ^ 2

10
f xf(x)

11
f radius area

12
Functions Top-down program design (pp. 87-90) Breaking problems down Code reuse (Don’t reinvent the wheel) How do we write functions in MATLAB?

13
MATLAB m-files Create a circleArea m-file

14
Sample function circleArea.m %circleArea = number -> number %takes the radius of a circle and returns the calculated area of a circle function outputValue = circleArea(radius) outputValue = pi * radius ^ 2;

15
Now, what if we want to calculate area of a ring A ring of two concentric circles = -

16
Area of a ring pi * (radius1)^2 – pi * (radius2)^2

17
Test area of a ring ringArea(2,1) ringArea(3,1) Etc.

Similar presentations

OK

General Computer Science for Engineers CISC 106 Lecture 02 James Atlas Computer and Information Sciences.

General Computer Science for Engineers CISC 106 Lecture 02 James Atlas Computer and Information Sciences.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google