1 / 19

General Computer Science for Engineers CISC 106 Lecture 02

General Computer Science for Engineers CISC 106 Lecture 02. James Atlas Computer and Information Sciences 9/4/2009. Objectives. Understand/explain how our Matlab program executes Use different types of Variables Use compound Expressions Access Matlab remotely. How does our program work?.

carterb
Download Presentation

General Computer Science for Engineers CISC 106 Lecture 02

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. General Computer Science for EngineersCISC 106Lecture 02 James Atlas Computer and Information Sciences 9/4/2009

  2. Objectives • Understand/explain how our Matlab program executes • Use different types of Variables • Use compound Expressions • Access Matlab remotely

  3. How does our program work? • CPU • Disk • Memory

  4. Our Program in Memory x86 instructions • ~~~~~~~~~~ • ~~~~~~~~~~ • ~~~~~~~~~~ • ~~~~~~~~~~ • ~~~~~~~~~~ • ~~~~~~~~~~ • ~~~~~~~~~~ • ~~~~~~~~~~ • . . .

  5. Variables • var = expression • x = 2 * 2 • comment = ‘This is a string’ • area = circleArea(5) What type of data is stored in each variable?

  6. 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

  7. Data Types in Matlab • Floating point number by default • “double” precision = 64-bits of memory

  8. Operations on Data Types • 5.5 • single(5.5) • int8(5) • int8(500) ? • int8(‘c’) ? • char(98) ? >> x = 5.5 >> whos x

  9. Expressions • Data and Operator • 2 + 2 • circleArea(5)

  10. Expressions • Data and Operator • 2 + 2 • circleArea(5) • Nested Expressions • circleArea(circleArea(5 + 2) + circleArea(3))

  11. Expressions • Data and Operator • 2 + 2 • circleArea(5) • Nested Expressions • circleArea(circleArea(5 + 2) + circleArea(3)) • Expressions produce a value

  12. Lab00 (pre-lab) / Lab01

  13. Unix Commands • When you log into a UNIX terminal • You are in your home directory. • To see the files in your directory. • ls • To make an new folder/directory. • mkdir exampledir • To change directories. • cd exampledir • To go back one directory. • cd .. • To go back to your home directory. • cd

  14. Handling files • cp file1 file2 • copy file1 and call it file2 • mv file1 file2 • move or rename file1 to file2 • rm file • remove a file • rmdir exampledir • remove a directory • cat file • display contents of a file • less file • display a file a page at a time

  15. Using Matlab Remotely (text) • ssh yourusername@strauss.udel.edu • requires an ssh program such as PuTTY • see course website for installation details • at prompt type: matlab -nodesktop

  16. Using Matlab Remotely (GUI) • Mac users: • You already have an X-Windows environment • PC 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

  17. Running Matlab Remotely • Once the X-Windows environment is setup, open a terminal window and login to strauss: • ssh -c arcfour,blowfish-cbc -YC yourusername@strauss.udel.edu • Now start Matlab: • matlab & • What does the & do?

More Related