Transcript
Page 1: General Computer Science  for Engineers CISC 106 Lecture 02

General Computer Science General Computer Science for Engineersfor Engineers

CISC 106CISC 106Lecture 02Lecture 02

James AtlasComputer and Information Sciences

Page 2: General Computer Science  for Engineers CISC 106 Lecture 02

CPU

Disk

Memory

How does our program work?

Page 3: General Computer Science  for Engineers CISC 106 Lecture 02
Page 4: General Computer Science  for Engineers CISC 106 Lecture 02
Page 5: General Computer Science  for Engineers CISC 106 Lecture 02

1. ~~~~~~~~~~2. ~~~~~~~~~~3. ~~~~~~~~~~4. ~~~~~~~~~~5. ~~~~~~~~~~6. ~~~~~~~~~~7. ~~~~~~~~~~8. ~~~~~~~~~~

. . .

x86 instructions

Our Program in Memory

Page 6: General Computer Science  for Engineers CISC 106 Lecture 02

VariablesVariablesvar = expression

x = 2 * 2comment = ‘This is a string’area = circleArea(5)

What type of data is stored in each variable?

Page 7: General Computer Science  for Engineers CISC 106 Lecture 02

How do computers store data?Binary

◦Billions of tiny logic gates representing ON and OFF (1 and 0)

Video◦ http://www.youtube.com/watch?

v=b6vHZ95XDwU

Page 8: General Computer Science  for Engineers CISC 106 Lecture 02

Data Types in MatlabFloating point number by default

◦“double” precision = 64-bits of memory

Page 9: General Computer Science  for Engineers CISC 106 Lecture 02

Operations on Data Types5.5single(5.5)int8(5)int8(500) ?int8(‘c’) ?char(98) ?

>> x = 5.5>> whos x

Page 10: General Computer Science  for Engineers CISC 106 Lecture 02

ExpressionsData and Operator

◦2 + 2◦circleArea(5)

Page 11: General Computer Science  for Engineers CISC 106 Lecture 02

ExpressionsData and Operator

◦2 + 2◦circleArea(5)

Nested Expressions◦circleArea(circleArea(5 + 2) +

circleArea(3))

Page 12: General Computer Science  for Engineers CISC 106 Lecture 02

ExpressionsData and Operator

◦2 + 2◦circleArea(5)

Nested Expressions◦circleArea(circleArea(5 + 2) +

circleArea(3))

Expressions produce a value

Page 13: General Computer Science  for Engineers CISC 106 Lecture 02

Lab00 (pre-lab) / Lab01

Page 14: General Computer Science  for Engineers CISC 106 Lecture 02

Using Matlab Remotely (text)ssh [email protected]

◦requires an ssh program such as PuTTY◦see course website for installation details

at prompt type:matlab -nodesktop

Page 15: General Computer Science  for Engineers CISC 106 Lecture 02

Using Matlab Remotely (GUI)Mac users:

◦ You already have an X-Windows environmentPC users:

◦ You must setup Cygwin-X◦ Download Cygwin setup.exe from:

http://www.cygwin.com/◦ Run setup.exe and select additional packages

for: xauth xinit openssh

Page 16: General Computer Science  for Engineers CISC 106 Lecture 02

Running Matlab RemotelyOnce the X-Windows environment is

setup, open a terminal window and login to strauss:◦ssh -YC [email protected]

Now start Matlab:◦matlab &

What does the & do?


Top Related