![Page 1: General Computer Science for Engineers CISC 106 Lecture 02](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/1.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/2.jpg)
CPU
Disk
Memory
How does our program work?
![Page 3: General Computer Science for Engineers CISC 106 Lecture 02](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/3.jpg)
![Page 4: General Computer Science for Engineers CISC 106 Lecture 02](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/4.jpg)
![Page 5: General Computer Science for Engineers CISC 106 Lecture 02](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/5.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/6.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/7.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/8.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/9.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/10.jpg)
ExpressionsData and Operator
◦2 + 2◦circleArea(5)
![Page 11: General Computer Science for Engineers CISC 106 Lecture 02](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/11.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/12.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/13.jpg)
Lab00 (pre-lab) / Lab01
![Page 14: General Computer Science for Engineers CISC 106 Lecture 02](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/14.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/15.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062407/56812caa550346895d91571e/html5/thumbnails/16.jpg)
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?