eng004 algorithms & int. to programming week 2 “exploring matlab” ahmet anıl dindar...

17
ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

Upload: ross-mckenzie

Post on 16-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004 ALGORITHMS & INT. TO PROGRAMMING

Week 2

“Exploring MATLAB”

Ahmet Anıl Dindar

28.02.2007

Page 2: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 2

The class facts

E-mail address: [email protected]

Class web page: http://web.iku.edu.tr/courses/insaat/eng004/

Page 3: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 3

Last week

The syllabus was distributed. The facts about the class was mentioned The class e-mail was introduced and the

students were asked to send a registration mail to the class e-mail.

Page 4: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 4

This week

What is Algorithm and Programming? Why do we need programs? A powerful tool- MATLAB What is MATLAB? Why MATLAB? HOw to use it? The first commands in

MATLAB.

Page 5: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 5

Algorithm and Programming

The best way to do some work is to know how to do it.

ALGORITHM

Some examples to Algorithm

Page 6: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 6

Programming

How to make a machine to perform the algorithms?

PROGRAMMING

How to program?

Page 7: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 7

You need some tools to make the machine perform your algorithms

Basic Pascal C,C++ Java Perl ...

Page 8: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 8

MATLAB

MATLAB (MATrix LABoratory) is a powerful program based on C++ and JAVA applications.

It has wide range of command library. Almost every engineering student in USA

uses MATLAB. Most of the Turkish Universities started

teaching MATLAB in introductory classes.

Page 9: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 9

MATLAB and Columns-Beams?What is the relationship?

MATLAB in Civil Engineering? Do we need it? Does any Civil Engineer

use MATLAB in work? Have you ever seen any

Civil Engineer using MATLAB?

Page 10: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 10

And now let’s see How MATLAB looks?

Follow me now!

Page 11: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 11

Let’s do some Calculations

The 4 basic calculation 1+2 5-1 15*2 8/4 (1+2)*5-1

Page 12: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 12

Gauss Number

1+2+3+...+100=?

Let’s use MATLAB

2

1....321

nnn

>> 100*(100+1)/2ans = 5050>>

Page 13: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 13

Assignment #1 Please do the following calculations in

MATLAB

>> 10*(10+1)/2

>> (10+50)*(10+20)/10

>>10*(10+1)+(10+1/2)*(58+1)

>>25/2+8-9

>>8+9*9-5

>> 8+9*(9-5)

>> (8+9)*9-5

Are there any difference between these calculations?

Page 14: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 14

Send your diary files to class e-mail

Page 15: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 15

Next week...

Weeks Date Class Assignment

1 21.02 Introduction to the class Registration

2 28.02 Exploring MATLAB Assignment 1

3 07.03 Arrays and Matrix Operations N.A.

4 14.03 Arrays and Matrix Operations Assignment 2

5 21.03 Arrays and Matrix Operations Assignment 3

6 28.03 Polynomials and curve-fitting Assignment 4

7 04.04 Descriptive statistics Assignment 5

8 11.04 Programming Elements of MATLAB N.A.

9 18.04 Programming Elements of MATLAB Assignment 6

10 25.04 Programming Elements of MATLAB Assignment 7

11 02.05 Plotting and Animations N.A.

12 09.05 Plotting and Animations Assignment 8

13 16.05 Numerical Integration Assignment 9

14 23.05 Symbolic Math Assignment 10

15 30.05 Take-home final project N.A.

Page 16: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 16

See you next week!

Page 17: ENG004 ALGORITHMS & INT. TO PROGRAMMING Week 2 “Exploring MATLAB” Ahmet Anıl Dindar 28.02.2007

ENG004.01 17