general computer science for engineers cisc 106 lecture 02
DESCRIPTION
General Computer Science for Engineers CISC 106 Lecture 02. James Atlas Computer and Information Sciences. How does our program work?. CPU Disk Memory. Our Program in Memory. x86 instructions. ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ - PowerPoint PPT PresentationTRANSCRIPT
General Computer Science General Computer Science for Engineersfor Engineers
CISC 106CISC 106Lecture 02Lecture 02
James AtlasComputer and Information Sciences
CPU
Disk
Memory
How does our program work?
1. ~~~~~~~~~~2. ~~~~~~~~~~3. ~~~~~~~~~~4. ~~~~~~~~~~5. ~~~~~~~~~~6. ~~~~~~~~~~7. ~~~~~~~~~~8. ~~~~~~~~~~
. . .
x86 instructions
Our Program in Memory
VariablesVariablesvar = expression
x = 2 * 2comment = ‘This is a string’area = circleArea(5)
What type of data is stored in each variable?
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
Data Types in MatlabFloating point number by default
◦“double” precision = 64-bits of memory
Operations on Data Types5.5single(5.5)int8(5)int8(500) ?int8(‘c’) ?char(98) ?
>> x = 5.5>> whos x
ExpressionsData and Operator
◦2 + 2◦circleArea(5)
ExpressionsData and Operator
◦2 + 2◦circleArea(5)
Nested Expressions◦circleArea(circleArea(5 + 2) +
circleArea(3))
ExpressionsData and Operator
◦2 + 2◦circleArea(5)
Nested Expressions◦circleArea(circleArea(5 + 2) +
circleArea(3))
Expressions produce a value
Lab00 (pre-lab) / Lab01
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
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
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?