1 / 13

General Computer Science for Engineers CISC 106 Lecture 22

Learn about the symbolic debugger in Matlab, setting breakpoints, viewing variables, stepping through code, and different classes of data types including single-precision floating point, double-precision, and various integers.

hert
Download Presentation

General Computer Science for Engineers CISC 106 Lecture 22

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 22 Dr. John Cavazos Computer and Information Sciences 04/13/2009

  2. Lecture Overview • Symbolic Debugger (137-140) • Date Types • Memory size/efficiency/accuracy

  3. Symbolic Debugger • Open m-file to debug in Matlab editor • Can set breakpoints • Where you want execution to suspend • Execute in command window as normal • , 2009 from 1:00 PM to 1:30 PM

  4. Symbolic Debugger • Execution suspends in editor at breakpoint • Can view variables in command window • Can step through the code • Can continue to next breakpoint17, 2009 from 1:00 PM to 1:30 PM

  5. Classes of Data Types

  6. Single-Precision floating point • Stores number in 32 bits • Bit 31 is sign (0 = positive, 1 = negative) • Bits 0 through 30 for number (exponent and fraction), 2009 from 1:00 PM to 1:30 PM

  7. Double-Precision (default) • Stores number in 64 bits • Bit 63 is sign (0 = positive, 1 = negative) • Bits 0 through 62 for number • (exponent and fraction), 2009 from 1:00 PM to 1:30 PM

  8. Integers (Signed Values) • int8 (8 bits) can represent -128 to 127 • int16, int32, int64 • x = int8(200) • x ←127 • x=int8(-500) • x ← -128;

  9. Integers (Unsigned Values) • uint8 (8 bits) can represent 0 to 255 • uint16, uint32, uint64 • x = uint8(400) • x ←255 • x=uint8(-500) • x ← 0;

  10. intmin and intmax • intmin(‘uint8’) • 0 • intmax(‘int8’) • 127

  11. Integer arrays • array = zeros(100,100, ‘int8’); • Creates a 100-by-100 int8 array initialized to zero.

  12. Efficiency • If array will only require certain values • Use correct datatype! • For example: • Images typically only have 0-255 values • Need only uint8

  13. Efficiency (cont’d) • double requires 8 bytes • uint8 requires 1 byte • Double requires 8 times more memory to store images!

More Related